For/Next Loop

J

Journey

I have the following macro that copies the value that in in cell A3 on the
EEInfo ws, pastes it to WOACreate worksheet and then print the WOACreate
worksheet.

What I want it to do is loop through all the values that are in column A on
the EEInfo worksheet starting with cell A3. there is other columns on the
worksheet, but I only want the values from each cell in column Acopied and
pasted onto the WOACreate worksheet and then printed before continuing.

Can anyone help with the looping. thanks in advance.

Sub Macro2()

Sheets("EEInfo").Select
Range("A3").Select
Selection.Copy
Sheets("WOACreate").Select
Range("C2").Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks :=False, Transpose:=False
Application.CutCopyMode = False
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

End Sub
 
J

Jim Thomlinson

Try something like this... (untested but it should be close)

Sub Macro2()
dim rngSourceAll as range
dim rngSource as range

with Sheets("EEInfo")
set rngsourceall = .range(.range("A3"), .cells(rows.count, "A").end(xlup))
end with

for each rngsource in rngsourceall
with Sheets("WOACreate")
.range("C2").value = rngsource.value
.printpreview 'change to .printout
end with
next rngsourceall
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top