VBA to count rows in a sheet and increase counter on another sheet then print

  • Thread starter Thread starter lgj32
  • Start date Start date
L

lgj32

I have a dataset which could have a variable number of rows on a sheet
called "Data", on the first sheet I have a template which shows all the
data for that record and in cell A1 the record number (starts at 1).

I need the Template sheet number to increase by one each time, print
then increase the number and print gain until it reaches the end of the
records on the "data" sheet.

At the moment I am manually typing in the record number and printing,
but there must be a simplier way by using VBA to automate this. I
haven't used macros for years and years so am very rusty can anybody
help?

Thanks
 
Is this because you just want the row number of copies, if so why not just
use

Dim iLastRow As Long
iLastRow = Worksheets("data").End(xlUp).Row
Worksheets("data").PrintOut copies:=iLastRow


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
Back
Top