MrExcel Publishing
Your One Stop for Excel Tips & Solutions

parsing the value of the Target variable...

Posted by Brian on February 11, 2002 1:52 PM

Using this function..

Private Sub Worksheet_Change(ByVal Target As Range)

I know that Target is the value. How do I see what the first or first two characters are? What I am doing is a schedule spreadsheet. The person wants to enter in the hours the employee works but also have a note next to it. So I need to be able to just get the number value for total hours worked. Am I making this hard?



Posted by DRJ on February 11, 2002 1:57 PM


This shouldnt be too hard, lets say you want the first two chars only of the target then

MyValue = Left(Target.Value,2)

This should give you the 2 left most chars