Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Vba exel

Status
Not open for further replies.

lordeos

IS-IT--Management
Aug 7, 2003
91
BE
Hello,

Is there a command in vba where that he calculates how many rows there are used.

example for 1 = to (command)

greetz,
Mike
 
couple of different ways

you can use
UsedRange
ie

for i = 1 to usedrange.rows.count

next i

OR, you can find the last used row manually as UsedRange can be unreliable - there are at least 2 FAQs on this subject within this forum - just have a look on the FAQs tab

Rgds, Geoff

Never test the depth of water with both feet

Help us to help you by reading FAQ222-2244 before you ask a question
 
If there are no blank rows you could use a Do...Loop until next row is empty. eg

i = 1
do
[commands]
i = i + 1
loop until cells(i,1) = ""

 
no point in looping - FIND and using the END functions are much, much, much, much quicker

Rgds, Geoff

Never test the depth of water with both feet

Help us to help you by reading FAQ222-2244 before you ask a question
 
Oke i use the usedrange.rows.count version :):)

Thx for the help.

Greetz,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top