jimmyk
03-24-2003, 08:51 AM
Hello. I'm trying to reformat cell values imported from Access into Excel as Phone Numbers. I am able to change the cell formats but since the number imported from Access has an apostrophe in front of it (I assume this is why) the Phone Number format won't show unless I manually retype the number. Note that in Access this field has a (@@@)@@@-@@@@ format.
I'm using the code below to insert a new column then go down the rows & move the value to the new column. This eliminates the apostrophe. However the format in the cell still won't change unless I manually enter the number. Thanks in advance for any help offered.
Cells(1, 10).Select
Selection.EntireColumn.Insert
myStop = Cells(1, 1).CurrentRegion.Rows.Count
For i = 3 To myStop
If Cells(i, 9) = Empty Then
'No action is performed
Else
Cells(i, 10) = Cells(i, 9)
End If
Next i
Columns("I:I").Select
Selection.Delete shift:=xlToLeft
'Columns("I:I").Select
Selection.NumberFormat = "[<=9999999]###-####;(###) ###-####"
Cells(1, 10).Select
I'm using the code below to insert a new column then go down the rows & move the value to the new column. This eliminates the apostrophe. However the format in the cell still won't change unless I manually enter the number. Thanks in advance for any help offered.
Cells(1, 10).Select
Selection.EntireColumn.Insert
myStop = Cells(1, 1).CurrentRegion.Rows.Count
For i = 3 To myStop
If Cells(i, 9) = Empty Then
'No action is performed
Else
Cells(i, 10) = Cells(i, 9)
End If
Next i
Columns("I:I").Select
Selection.Delete shift:=xlToLeft
'Columns("I:I").Select
Selection.NumberFormat = "[<=9999999]###-####;(###) ###-####"
Cells(1, 10).Select