Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default trim

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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trim Jim Excel Discussion (Misc queries) 4 February 2nd 10 03:00 PM
Trim help please Dave New Users to Excel 8 September 1st 05 07:18 PM
VBA Trim and Application.worksheetfunction.Trim Hari Prasadh Excel Programming 3 January 19th 05 02:22 PM
Trim in VBA Otto Moehrbach[_6_] Excel Programming 4 May 18th 04 05:23 PM
Trim like worksheet Trim Bob Phillips[_5_] Excel Programming 0 August 20th 03 07:10 PM


All times are GMT +1. The time now is 10:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"