Forum Discussion
Lorenzo Kim
Jul 14, 2018Bronze Contributor
runtime error 1004 : Method range of object - 'Global' failed
How do I correct this? (kindly see images) many many thanks
- Jul 17, 2018
You can drop the WorksheetFunction portion for easier readability:
New_text = Application.Substitute(Cell_reference,"TOTAL","")
Lorenzo Kim
Jul 14, 2018Bronze Contributor
Mr. Chan
Here I am again, pardon for the bother..
kindly help with the small snippet below
I wish to erase in a range of column the word "Total" in a cell.
in EXCEL it is =left(cellText, len(cellText)-5)
How do I write it in vba?
many many many thanks
Sub RemoveWordTotal()
Application.ScreenUpdating = False
Dim i As Long
For i = Cells(Rows.Count, "B").End(xlUp).Row To 2 Step -1
' remove the word total inside a column range cell
Next i
Application.ScreenUpdating = True
End Sub
Lorenzo Kim
Jul 15, 2018Bronze Contributor
the word "Total" is in the rightmost part of the cell
ex: "Customer ABC Total"; "Item 123 Total" etc..
ex: "Customer ABC Total"; "Item 123 Total" etc..