Macro repeat command

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

palko

Thread Starter
Joined
Sep 11, 2003
Messages
6
Created a macro via excel from a database and it runs as I planned. But how do I have it repeat the sequence until it runs out of data?
It is a database from where a report is generated for the participants. Mine stops after executing the first line BUT it is to go on untill it reaches the last line.

Thanks.

palko
 
Joined
Aug 30, 2003
Messages
2,702
Perhaps Palko means "how do I make it work for each row in the database?" (?)

What's yr preference CH? Wrap it with

Do Until Active Cell = ""
(do stuff)
ActiveCell.Range("A2").Select
Loop

or

For Each ? in ?
(do stuff)
Next

Rgds,
Andy
 
Joined
May 4, 2002
Messages
743
Hello palko
Hey there XLG -

Without knowing a wee bit more about the macro, it is hard to say. But I would envision a simple

Do Until ActiveCell = ""
Loop

Palko, give a hint as to what your macro is doing!

- C
 

palko

Thread Starter
Joined
Sep 11, 2003
Messages
6
I have a database (120 lines with certain info).
The data changes every month.
From this database I need to send a statement with selected information to each participant.
The macro I recorded does exactly what I ask, but just for the first line.
I'd like it to go line by line and print the statements from each line.
Thanks

:)

The statement is on a FORM (template)

I can print out the macro and send it via fax to anyone will9ing to tackle this and with the fax goes my many thanks
 
Joined
Aug 30, 2003
Messages
2,702
What's a fax?

For this you need (a) 2 worksheets (the form, plus your customer list) (b) x cells on the form sheet using OFFSET function to pull in your data from the list sheet (c) a "control" cell on the form sheet to increment by 1 over and again until it reaches the number of customers (d) ½ a dozen lines of code.

If you'd like me to mail you a tiny demo file just ask.

Rgds,
Andy
 
Joined
May 4, 2002
Messages
743
" Just the fax, mam!"


Well, I'm kinda of curious now. Send me that 'fax' thingy, Palko!




- Castleheart :cool:



XLG, I smell smoke! Your gears must be spinning!
I think I am going to go off in a slightly different direction. we'll see if i get lost..........

(PS: Well, Palko.... you make it difficult to send you a fax # with Email or messaging. Get up with me.)
 
Joined
Aug 30, 2003
Messages
2,702
CH, soz can't hang, early start tomorrow.

Range("Form!K1") = 0
'counter cell
Do Until Range("Form!K1") = Range("Form!K2")
'K2 formula =COUNTA(Sheet2!A:A)-1,
# of data rows - header row
Range("Form!K1") = Range("Form!K1") + 1
Sheets("Form").PrintOut Copies:=1, Collate:=True
Loop
Range("Form!K1") = 0

Form sheet cells contain eg:
=OFFSET(Sheet2!$A$1,Form!$K$1,0)
to pull in data sequentially as K1 increments thru looping.

Rgds,
Andy
 

palko

Thread Starter
Joined
Sep 11, 2003
Messages
6
If you Honorable Gentlemen would kindly give me your email address I would attach the database, the template and my explanation of what I am trying to accomplish.
And if you succeed, I will be a MU fan for life. :)
And I firmly believe that it was a treason for B to go to the Royals.
:)
 
Joined
Aug 30, 2003
Messages
2,702
>> if you succeed, I will be a ** fan for life

Hmm ... I'm surprised swearing's allowed in these groups. Reminds me of a humorous radio interview --

"Where are you from?"
"Manchester".
"& who do you support?"
"Man City".
"Really? Why?"
"Because I'm from Manchester".

Best rgds,
Andy
 
Joined
May 4, 2002
Messages
743
I was asleep.

But I think I am not now.



Would ya'll across the way kindly lean out your windows and whistle for ISABEL. Maybe she'll swing on east. She's awful mean, and she's bearing right down our way!

Palko,
Send the schtuff by clicking the
button below - - - - - - - v
 

Anne Troy

Anne
Joined
Feb 14, 1999
Messages
11,746
palko: The guys are trying to say that they cannot send you their fax number or email address because, in your User Panel, you do not have "allow private messaging" or "allow members to see your email address" checked. They don't want to put that information right out in a public forum anymore than you do.

:)
 
Joined
Aug 30, 2003
Messages
2,702
Meanwhile, palko mailed me direct to advise that someone had fixed it for him IRL "for 20 bucks".

Apols for the oversight, should've updated.

Rgds,
Andy
 

Anne Troy

Anne
Joined
Feb 14, 1999
Messages
11,746
I don't watch the news. Thanks for the warning!
Now you know why they call that Water Street there in East Greenville....hee hee.

Don't worry. Hubby says we've got candles and food. I've got a water cooler right here in the house with 3 backup 5-gallon bottles, so we're doing okay. :)
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top