I have an Excel spreadsheet that contains, among other things a column that contains both names and Social Security numbers. I need to extract the Social Security numbers from each cell. My problem seems to be incorrect usage of the Right function.
The code that I have written is:
Dim SSN As String
Range("A1").CurrentRegion.Columns(9).Select
For Each cell In Selection
SSN = RIGHT(RC[-6],9)
MsgBox SSN
Next cell
End Sub
The syntax for the Right function line is taken from a macro created while manually typing in the function to an Excel cell.
This is just to test the concept. Ultimately, I need to put the Social Security number in each cell in a column distinct from the original column.
Bookmarks