What is the code for determining if the next cell in a given column is empty from within VB?
What is the code for determining if the next cell in a given column is empty from within VB?
Do you mean the cell below the current (active) cell? If so, this will tell you:
HTH![]()
If IsEmpty(ActiveCell.Offset(1, 0)) Then ' next cell is empty Else ' next cell is not empty End If
Jason
What i mean is that if i have a column with values from A1:A30 and A31 is empty then i would like to identify that and perform some calculations at that point. Will the above code do that? Sorry i'm very new to VB.Originally Posted by jasoncw
In your example, this will tell you the next empty cell in a column:
You can either activate this cell, or determine the address, or various other coding with this information:![]()
Range("A1").End(xlDown).Offset(1, 0)
HTH![]()
Range("A1").End(xlDown).Offset(1, 0).Select Range("A1").End(xlDown).Offset(1, 0).Address etc.
Jason
Determining the Address is most likely what i need. Now my question is in which format will the address be returned. I assume is AX. If so how do i get rid of the letter and only keep the number of the row for further calculations?Originally Posted by jasoncw
If the first blank cell is A10, it will return $A$10. If you want just the row number, you can use:
Jason![]()
Range("A1").End(xlDown).Offset(1, 0).Row
You may need to tell us what are you trying to do in order for us to help..Originally Posted by SER01
this will take you to the next empty cell
ot this![]()
Range("A1").End(xlDown).Offset(1, 0).Select
![]()
Range("A65536").End(xlUp).Offset(1, 0).Range("A1").Select
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks