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

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default For..Next loop problem

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" wrote in message
...
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?

Thanks

Dwaine Horton
York International



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
do while loop problem April Excel Discussion (Misc queries) 4 October 18th 09 07:51 PM
loop problem teepee[_3_] Excel Discussion (Misc queries) 3 December 31st 08 11:09 AM
Does loop function cause this problem? Eric Excel Worksheet Functions 3 July 1st 07 01:40 PM
Find and Copy loop problem BillyJ Excel Discussion (Misc queries) 3 November 2nd 05 07:16 PM
loop problem joao Excel Programming 4 November 6th 03 02:01 PM


All times are GMT +1. The time now is 04:42 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"