|
-
Oct 11th, 2004, 02:43 AM
#1
Thread Starter
Frenzied Member
Stripping spaces from a number in Excel ...
I've got a column of numbers.
Each number is 19 digits long, and there are NO leading zeros.
Unfortunately, these numbers have intermittent spaces in the middle of them which I need to strip out.
e.g. 292 393 67675363 98769
I tried using the INSTR function, but that was giving me some weird results.
This is pretty urgent, so any input would be greatly appreciated.
Cheers
Steve
p.s. I have posted in the VBA forum, but I need an answer pretty quick and no-one is in there
Last edited by TheBionicOrange; Oct 11th, 2004 at 03:20 AM.
-
Oct 11th, 2004, 02:50 AM
#2
G'Day TheBionicOrange,
Can you use Replace whilst iterating past each Row, like:
VB Code:
MsgBox Replace("292 393 67675363 98769", " ", "")
Bruce.
-
Oct 11th, 2004, 02:58 AM
#3
Steve,
This will iterate past Column A and do all used rows:
VB Code:
Dim intRowMax As Integer, intRowIdx As Integer
intRowMax = ActiveSheet.UsedRange.Rows.Count
For intRowIdx = 1 To intRowMax
ActiveSheet.Range("A" & intRowIdx).Value = Replace( ActiveSheet.Range("A" & intRowIdx).Value, " ", "")
Next
Bruce.
Last edited by Bruce Fox; Oct 11th, 2004 at 03:01 AM.
-
Oct 11th, 2004, 03:18 AM
#4
Thread Starter
Frenzied Member
Cheers Bruce (why am I now thinking of Finding Nemo !!!)
Always tend to overlook the obvious when I'm in a flap 
[edit] Thanks for that extra bit too [/edit]
-
Oct 11th, 2004, 03:24 AM
#5
Know what you mean 
Good to see you back on the ol (VB) forum.
Cheers,
Bruce.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|