Thread: Looping
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Maggie[_6_] Maggie[_6_] is offline
external usenet poster
 
Posts: 3
Default Looping

TY Sean ... but it's not doing what i want, I'll to give more details....

The value in Cell N1 needs to change after every print.
Example:
My first print will have the value of 1 in cell N1, then macro command to
print page, then I automatically want the value in cell N1 to change to 2
then print, and so on until let's say page 30.

Does this make sense???

Maggie



--
MDP


"Sean Timmons" wrote:

Depends on what you want to do with your loop. If you just want to do it 5
times regardless, you can do a couple things. Easiest would be change
printout copies:= to 5. :-)

If you want to change a value, say your "Value", then something like

For i = 1 to 10
ActiveCell.FormulaR1C1 = "Value"
Range("N2").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("N1").Select
"value" = "Value+1
Next i

Course, you may want to do other calculations, so it depends.

BTW, looks like your range.Select lines aren't needed.

"Maggie" wrote:

I need some help ....
How can I loop the following cammand

ActiveCell.FormulaR1C1 = "Value"
Range("N2").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("N1").Select

--
MDP