Link to home
Start Free TrialLog in
Avatar of pubbuddy
pubbuddy

asked on

I have a column, in Excel. In each cell there is a number, followed by a period and then a word. Can I delete the number, some one digit, some 2 & some three, and keep the word?

I have:

1. Mary
2. Fred
3. Allan

It goes on to:

100. Alice
Can I use, "Find / Replace", or something, and delete the numbers and periods, in one action, and keep the names?

That's it.

Thanks!
Avatar of Saurabh Singh Teotia
Saurabh Singh Teotia
Flag of India image

Assuming you have data from cell A1 then in B1 you can apply this formula which will get only the names..

=RIGHT(A1,LEN(A1)-FIND(" ",A1))

And then you can drag it further down to just to get names from your data..

Saurabh...
Hi,

quickest way may be to use text to column wizard in excel and set the delimiter to "."; it'll give you two columns one full of numbers and the other full of the names, delete the column with the numbers.

Thanks

Christopher
Avatar of Professor J
Professor J

select the column then go to Data tab and then Text to Column and then select delimited and then click Next and then unmark all and mark "other" and in the box put . period and then click next finish. it will seperate your data and then you can delete the unwanted column
To delete the number and the period you can use this macro.

Sub RemoveNumbers()
Const COL = "A"
Const FIRST_ROW = 1
Dim lngLastRow As Long
Dim lngRow As Long
Dim strParts() As String

lngLastRow = Range(COL & "1048576").End(xlUp).Row

For lngRow = FIRST_ROW To lngLastRow
    strParts = Split(Cells(lngRow, COL), ".")
    Cells(lngRow, COL) = strParts(1)
Next

Open in new window


Just in case you need them, here are instructions on how to install and use the macro.

In Excel, Press Alt+F11 to open the Visual Basic Editor (VBE)

Right-click on your workbook name in the "Project-VBAProject" pane (at the top left corner of the editor window) and select Insert -> Module from the context menu

Copy the macro (you can use the ‘Select All’ button if you like) and paste it into the right-hand pane of the VBA editor ("Module1" window)

Press Alt+F11 again to go back to Excel

Optionally, press Alt+F8 to open the "Macro" dialog window. Select the macro, click ‘Options…’,  hold down the Shift key and type the letter A (or any other letter) and click ‘OK’. Then anytime you want to run the macro press Ctrl+Shift+A.
ASKER CERTIFIED SOLUTION
Avatar of Subodh Tiwari (Neeraj)
Subodh Tiwari (Neeraj)
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pubbuddy

ASKER

How, absolutely, simple; and perfect.
This is the ultimate example of why you guys are in business. I wish there was a grad above, A.
Glad I could help.
And thanks for the compliment also. :)