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","")
Haytham Amairah
Jul 14, 2018Silver Contributor
Hi Lorenzo,
The Cells function requires two arguments: RowIndex & ColumnIndex
Both must be a number, not a text!
You put the text "C" in the ColumnIndex, so try to replace it with 3 instead.
Regards
Lorenzo Kim
Jul 14, 2018Bronze Contributor
Mr. Amairah
Thank you for your time...
Thank you for your time...
- Matt MickleJul 14, 2018Bronze Contributor
This is a good example of when it pays to debug the code using F8. You can step through the code one line at a time and then hover over the variable in order to get it's value.....or you van use a watch which you can see in the immediate window or perhaps even type in a statement into the immediate window....
This will save you a ton of time in the long run....
Watch Window
https://www.youtube.com/watch?v=19JTjCtFPeI
Immediate Window
- Lorenzo KimJul 14, 2018Bronze ContributorMr. Mickle
thank you for the tip..