Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default For/Next Loop

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


--
jsm
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default For/Next Loop

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

--
HTH...

Jim Thomlinson


"Journey" wrote:

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


--
jsm

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
returning back to loop check condition without completing the loop ashish128 Excel Programming 13 April 3rd 08 12:53 PM
Loop to Filter, Name Sheets. If Blank, Exit Loop ryguy7272 Excel Programming 3 February 5th 08 03:41 PM
Naming Worksheets - Loop within a loop issue klysell Excel Programming 5 March 29th 07 05:48 AM
(Complex) Loop within loop to create worksheets klysell Excel Programming 1 March 20th 07 12:03 AM
Advancing outer Loop Based on criteria of inner loop ExcelMonkey Excel Programming 1 August 15th 05 05:23 PM


All times are GMT +1. The time now is 08:37 AM.

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

About Us

"It's about Microsoft Excel"