Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
jrh jrh is offline
external usenet poster
 
Posts: 5
Default looping to create multiple files

I got this to work but then in order to change the list of
rep names, the person would have to go into the code. How
can I set the array to be cells on a particular
spreadsheet?

Thank you.
-----Original Message-----
try something like this:
Dim repNames as variant, i as integer
repNames=Array("Rep numb1", "rep2", "rep3")
' the array must contain the reps names you use
' on your code actually
for i=0 to ubound(repNames)
' this is your loop you are looking for
' you can use your code for one rep
' and the name of the sales rep is contained
' in repnames(i) like this
msgbox repNames(i)
' so you need to detect which instructions are
' for exactly one rep sales and put that code here
next i


-----Original Message-----
I wrote code that takes a template, populates it with a
Sales Rep's personal data, remove sales that aren't

theirs
and then saves the file as their file with a user
specified as of date. I then have code for each sales

rep
repeating the above.

Instead, can I write the code only once and then use a
loop to cycle through a list of all the reps maintained

on
a separate spreadsheet? This way, the code can be only
one person long and it will be easier to add things to

the
macro and revise the macro.

I do not know how to write a loop.
Thank you
.

.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default looping to create multiple files

You save time if you ask completely for the first time,

you can use something like:
Dim list As Variant, i
list = ActiveSheet.Range(Range("A1"), _
Range("A1").End(xlDown)).Value
For i = 1 To UBound(list)
MsgBox list(i, 1)
Next i



Francisco Mariscal
fcomariscal at hotmail dot com



-----Original Message-----
I got this to work but then in order to change the list

of
rep names, the person would have to go into the code.

How
can I set the array to be cells on a particular
spreadsheet?

Thank you.
-----Original Message-----
try something like this:
Dim repNames as variant, i as integer
repNames=Array("Rep numb1", "rep2", "rep3")
' the array must contain the reps names you use
' on your code actually
for i=0 to ubound(repNames)
' this is your loop you are looking for
' you can use your code for one rep
' and the name of the sales rep is contained
' in repnames(i) like this
msgbox repNames(i)
' so you need to detect which instructions are
' for exactly one rep sales and put that code here
next i


-----Original Message-----
I wrote code that takes a template, populates it with a
Sales Rep's personal data, remove sales that aren't

theirs
and then saves the file as their file with a user
specified as of date. I then have code for each sales

rep
repeating the above.

Instead, can I write the code only once and then use a
loop to cycle through a list of all the reps maintained

on
a separate spreadsheet? This way, the code can be only
one person long and it will be easier to add things to

the
macro and revise the macro.

I do not know how to write a loop.
Thank you
.

.

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i link multiple files (tif files) to one cell Kerry Excel Discussion (Misc queries) 0 July 31st 08 06:03 PM
LOOPING multiple ranges Jase Excel Discussion (Misc queries) 1 April 7th 08 06:21 PM
view multiple files in multiple windows on multiple screens. tcom Excel Discussion (Misc queries) 7 September 15th 05 09:35 PM
How do i auto create multiple files from 1 with multiple sheets Kathy Excel Worksheet Functions 0 July 26th 05 01:23 AM
How can I view files chronologically when opening multiple files Stevilsize Excel Discussion (Misc queries) 3 July 26th 05 12:49 AM


All times are GMT +1. The time now is 02:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"