That's how I interpreted your question and that's what the code does ... although I have assumed the range of cells in column 1 has no gaps in it
Sub PrintSheets()
Dim cell As Range
For Each cell In Range("A1:A" & Range("A" & Rows.Count).End(xlUp).Row)
Sheets("Sheet2").Range("A1") = cell
' Sheets("Sheet2").PrintPreview ' for testing
Sheets("Sheet2").PrintOut
Next
End Sub
This:
Range("A" & Rows.Count).End(xlUp).Row
works out the last row in column A with data in it. If that were, say, 6, it would be the same as:
And the loop would be:
For Each cell In Range("A1:A6")
This:
Sheets("Sheet2").Range("A1") = cell
set the value of cell A1 in Sheet2 to the value in the "cell being processed".
Sheets("Sheet2").PrintOut
prints it out, and:
loops around for the next value.
So, what is it that doesn't work? Does it fail because it tries to print a sheet with no data in it? Are the sheets actually called Sheet1 and Sheet2? Which cells actually have data in them? How would you like me to help you modify the script?
Bookmarks