end of range question

austin350s10

Active Member
Joined
Jul 30, 2010
Messages
321
Why is it when running the following code it returns "B35"? It should return "B32" My only thought it that since the test range only contains one cell with data it jumps down to the next range.

I have used the same code on other ranges that have more than one cell with data and it works fine.

Does anyone know of a work around?

Here is the code:

Code:
Dim newrange As String

newrange = Range("B32").End(xlDown).Address

MsgBox newrange

Here is the sheet in reference:
excel-table-1.png
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
The code does the same thing as pressing Ctrl+Down.
 
Upvote 0
well I am looking for the last cell that contains data before a blank cell. Lets say it started at B39 to would return B45. I am mostly using the code for larger sets of data like B39 to B45. B32 was the only set of data that was giving me a problem. Do I need to use a different code?
 
Upvote 0

Forum statistics

Threads
1,224,594
Messages
6,179,794
Members
452,943
Latest member
Newbie4296

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top