![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: Liverpool UK
Posts: 66
|
I realise this is not the place.... But my recordset is nearly 1 million. So Access would be the easiest way forward.
I have tel numbers containing all sorts of spaces, dashes etc,in one column. I want to run an update query to an empty column which removes blanks and dashes leaving the tel no as a the numbers ie 01253-202121 would be 01253202121 This is in order that I can lookup and match on telno from another list. Any help would be appreciated |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
I'm not familiar with the VBA for Access, but in excel you could do it in the following way:
Code:
Sub OnlyNumbers() Dim FinalStr As String For i = 1 To Len(ActiveCell.Value) If IsNumeric(Mid(ActiveCell.Value, i, 1)) = True Then FinalStr = FinalStr + Mid(ActiveCell, i, 1) Next ActiveCell.Value = FinalStr Hope this helps. Kind regards, Al. [ This Message was edited by: Al Chara on 2002-04-18 10:10 ] |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Liverpool UK
Posts: 66
|
thanks Al, thats great, its just the volume of numbers....
|
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
If you could get your data into excel then you could throw the code into a FOR loop that will do EACH cell in the ACTIVESHEET's USEDRANGE.
__________________
Kind regards, Al Chara |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|