View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Crowbar via OfficeKB.com Crowbar via OfficeKB.com is offline
external usenet poster
 
Posts: 128
Default Help finding the length of two different columns

Considering that all the cells in the column are occupide this will return
the value of the next vacant cell, give it a try, it might be what you need

Use this for column A

For x = 1 to 65536
If sheet1.cells(x, 1).value = "" then
msgbox "" & x
end if
exit for
next

Use this for column B

For y = 1 to 65536
If sheet1.cells(y, 2).value = "" then
msgbox "" & y
end if
exit for
next

It looks for the first instance of nothing and then returns the row number

P.S. On the second line of each script it says Sheet1 change this to Sheets
("YOUR SHEET NAME") ie

For y = 1 to 65536
If sheets("Your Sheet ").cells(y, 2).value = "" then
msgbox "" & y
end if
exit for
next



--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200603/1