For..Next loop problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a spreadsheet that I need to load data from another spreadsheet. The spreadsheet I want the data loaded into is a template and the other spreadsheet can have one to N rows. How can I progammaticly find out how many rows I have in my second spreadsheet and then use that in my for..next loop

Thank

Dwaine Horto
York International
 
Dwaine,

You determine a key column, and then working up from the final row in the
spreadsheet until you hit a cell with data

cLastRow = Cells(Rows.Count,"A").End(xlUp).Row

change A for your column.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

Dwaine Horton said:
I have a spreadsheet that I need to load data from another spreadsheet.
The spreadsheet I want the data loaded into is a template and the other
spreadsheet can have one to N rows. How can I progammaticly find out how
many rows I have in my second spreadsheet and then use that in my for..next
loop?
 
Back
Top