Lookup the last value in a range and selecting the date

Sjodom

New Member
Joined
Jun 19, 2010
Messages
17
Hello,

I have a worksheet that has ranges of string values that contain a date within the first 5 characters. I am able to locate the date from the cell:

=MID(R10,1,5)

But I am now having difficulty locating the last cell in a general range with value. I have found macros to assist:

Selection.End(xlToRight).Select

But is then incompatible with the above cell formula.

Any ideas?
 
...

Aladin -
This makes more sense. After playing with the formula and changing the values, I was able to see what sections effected the result. Specifically, the +0 at the end and the REPT("z",255). I am not sure why you chose "z" or 255, other values seemed to produce the same outcome.

...

REPT("z",255) has the same role as 9.99999999999999E+307 that you see in the link I provided. It's lexically/alpahbetically the latest value in most natural languages. These are values which are deemed not to occur in data we can be expected to work with. The former is intended to be used with references housing text, the latter with references housing numeric data. The latter is a limit value in Excel and as such is reported in Excel's Help. The big text, which the former boils down to, is designed by Mark W. in analogy with the latter. And, as such there is no need to create variants of these values.
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Forum statistics

Threads
1,214,945
Messages
6,122,395
Members
449,081
Latest member
JAMES KECULAH

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