Hello All.
I am using the macro recorder in XP Pro.
My task is to take the data in column A, use Trim sd replace the data in column A with the "new Trimmed" data.
The steps I have taken are:
Insert a column to the right of column A.
In that column (B) use the Trim function and copy paste it down all the rows (about 1,200) as applicable.
Copy paste/value the "Trimmed" data in column B to column A and delete column B.
The result I keep getting is the first rows data getting copied down only.
Example: rows A3 thru A5 has the following data - 98765 (A3) / 76543 (A4) / 23478 (A5) only 98765 gets copied down the entire field.
I have included my macro for guidance.
Thanks for any and all help.
Sub Macro3()
'
' Macro3 Macro
' Macro recorded 9/29/2003 by AM
'
'
Selection.EntireColumn.Insert
ActiveCell.FormulaR1C1 = "=TRIM(RC[-1])"
Range("B3"
.Select
Selection.AutoFill Destination:=Range("B3:B1041"
Range("B3:B1041"
.Select
Calculate
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Columns("A:A"
.Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
ActiveCell.FormulaR1C1 = "c"
Range("A2"
.Select
End Sub
I am using the macro recorder in XP Pro.
My task is to take the data in column A, use Trim sd replace the data in column A with the "new Trimmed" data.
The steps I have taken are:
Insert a column to the right of column A.
In that column (B) use the Trim function and copy paste it down all the rows (about 1,200) as applicable.
Copy paste/value the "Trimmed" data in column B to column A and delete column B.
The result I keep getting is the first rows data getting copied down only.
Example: rows A3 thru A5 has the following data - 98765 (A3) / 76543 (A4) / 23478 (A5) only 98765 gets copied down the entire field.
I have included my macro for guidance.
Thanks for any and all help.
Sub Macro3()
'
' Macro3 Macro
' Macro recorded 9/29/2003 by AM
'
'
Selection.EntireColumn.Insert
ActiveCell.FormulaR1C1 = "=TRIM(RC[-1])"
Range("B3"
Selection.AutoFill Destination:=Range("B3:B1041"
Range("B3:B1041"
Calculate
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Columns("A:A"
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
ActiveCell.FormulaR1C1 = "c"
Range("A2"
End Sub