Trying to create a subroutine that takes a selected range and loops through each cell trimming off all but the first five characters. Current code is as follows:
Sub TrimAcntNo()
Dim Cell As Range
For Each Cell In Selection
ActiveCell.Formula = "=Left(activecell,5)"
Next Cell
End Sub
I am getting a #Name error message when I run this code.
Just trying to run through the cells and trim off all but the first 5 characters.
TIA,
tcardwell
Sub TrimAcntNo()
Dim Cell As Range
For Each Cell In Selection
ActiveCell.Formula = "=Left(activecell,5)"
Next Cell
End Sub
I am getting a #Name error message when I run this code.
Just trying to run through the cells and trim off all but the first 5 characters.
TIA,
tcardwell