I have a range of data A2:E16 in which each row needs to be copied and pasted into another worksheet cell by cell. After this the worksheet needs to be printed, this needs to repeat for each row in the range. I recorded a macro for the action I want repeated, when I tried a For loop I entered an infinite loop of printing the same thing. So my loop didn't cycle row by row through the range and it never stopped. I'm using VB6.5 and excel 2007. This is a sample range of the entire data, it will take days to print these one by one without a macro. Your help will be greatly appreciated. Below is the macro I've been working with
' quickprint Macro
'
' Keyboard Shortcut: Ctrl+h
'
Dim i As Variant
Sub Cell_Loop()
For Each i In Worksheets("Modified").Range("A2:E16").Cells
Range("A2").Select
Selection.Copy
Sheets("Sign").Select
Range("D21:P31").Select
ActiveSheet.Paste
Range("W21:AI31").Select
ActiveSheet.Paste
Sheets("Modified").Select
Range("B2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sign").Select
Range("D2:P17").Select
ActiveSheet.Paste
Range("W2:AI17").Select
ActiveSheet.Paste
Sheets("Modified").Select
Range("C2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sign").Select
Range("D18:P20").Select
ActiveSheet.Paste
Range("W18:AI20").Select
ActiveSheet.Paste
Sheets("Modified").Select
Range("D2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sign").Select
Range("E32:H36").Select
ActiveSheet.Paste
Range("X32:AA36").Select
ActiveSheet.Paste
Sheets("Modified").Select
Range("E2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sign").Select
Range("M32:P36").Select
ActiveSheet.Paste
Range("AF32:AI36").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,2,,,TRUE,,FALSE)"
Next i
End Sub
End Sub
' quickprint Macro
'
' Keyboard Shortcut: Ctrl+h
'
Dim i As Variant
Sub Cell_Loop()
For Each i In Worksheets("Modified").Range("A2:E16").Cells
Range("A2").Select
Selection.Copy
Sheets("Sign").Select
Range("D21:P31").Select
ActiveSheet.Paste
Range("W21:AI31").Select
ActiveSheet.Paste
Sheets("Modified").Select
Range("B2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sign").Select
Range("D2:P17").Select
ActiveSheet.Paste
Range("W2:AI17").Select
ActiveSheet.Paste
Sheets("Modified").Select
Range("C2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sign").Select
Range("D18:P20").Select
ActiveSheet.Paste
Range("W18:AI20").Select
ActiveSheet.Paste
Sheets("Modified").Select
Range("D2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sign").Select
Range("E32:H36").Select
ActiveSheet.Paste
Range("X32:AA36").Select
ActiveSheet.Paste
Sheets("Modified").Select
Range("E2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sign").Select
Range("M32:P36").Select
ActiveSheet.Paste
Range("AF32:AI36").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,2,,,TRUE,,FALSE)"
Next i
End Sub
End Sub