R
RobcPettit
Hi, could somebody advice on how to trim using vba. Im trimming data
like;
"21 22 3 4" or "20 2 22 3". All I need from these are the firs two
numbers so for these two It would be "21 22" & "20 2". Ive tried
x = ActiveCell.Value
y = Left(x, 2)
z = Left(x, 5) y to get the first number then I was going to use z to
get the first two numbers and then 'right' to get the second number.
Then I realised Id have a problem with single digit numbers. Now I
thinking is there a away of getting the numbers using the spaces as a
reference. x = first number before first space, z = second number
between first and second space.
Regards Robert
like;
"21 22 3 4" or "20 2 22 3". All I need from these are the firs two
numbers so for these two It would be "21 22" & "20 2". Ive tried
x = ActiveCell.Value
y = Left(x, 2)
z = Left(x, 5) y to get the first number then I was going to use z to
get the first two numbers and then 'right' to get the second number.
Then I realised Id have a problem with single digit numbers. Now I
thinking is there a away of getting the numbers using the spaces as a
reference. x = first number before first space, z = second number
between first and second space.
Regards Robert