I have a need to delete leading characters (5) from the same column (D) across multiple worksheets. I can get it to work on a single spreadsheet using the following code:
Every time I add a workbook this doesn't want to run. In this case I need to remove my worksheet names are John, Ralph, Mary and Virginia.
I have set the sheets and tried to enter a sheet name before the line "For Each" to see if it would work.
Any ideas?
Code:
Sub RemoveCORP()
Range("A1").Value.Activate
For Each Cell In Range("D2", Range("D1000").End(xlUp))
If Not IsEmpty(Cell) Then
Cell.Value = Right(Cell, Len(Cell) - 5)
End If
Next Cell
End Sub
Every time I add a workbook this doesn't want to run. In this case I need to remove my worksheet names are John, Ralph, Mary and Virginia.
I have set the sheets and tried to enter a sheet name before the line "For Each" to see if it would work.
Any ideas?