Good afternoon!
I'm trying to come up with code and keep the same type of method consistent with the spreadsheet that I inherited. I've had a lot of luck with this forum, thanks to JonMo1 and others, with a similar issue and I was hoping I'd have the same luck with this issue:
I'm trying to come up with code to remove 'hyphens' in only one column (column I) in a loop (not the entire worksheet).
To be consistent with the methods, I was playing around with WorksheetFunction.Replace (not even sure that's the best function to use- what about WorsheetFunction.Substitute?), but couldn't figure out how to define the range to column I (named "License").
An example of the loop used in the spreadsheet:
I was hoping for something like:
THANKS FOR YOUR HELP IN ADVANCE!
I'm trying to come up with code and keep the same type of method consistent with the spreadsheet that I inherited. I've had a lot of luck with this forum, thanks to JonMo1 and others, with a similar issue and I was hoping I'd have the same luck with this issue:
I'm trying to come up with code to remove 'hyphens' in only one column (column I) in a loop (not the entire worksheet).
To be consistent with the methods, I was playing around with WorksheetFunction.Replace (not even sure that's the best function to use- what about WorsheetFunction.Substitute?), but couldn't figure out how to define the range to column I (named "License").
An example of the loop used in the spreadsheet:
Code:
For Each oCell In Target
oCell.Value = WorksheetFunction.Trim(oCell.Value)
Next oCell
I was hoping for something like:
Code:
For Each oCell In Target
oCell.Value = [COLOR=red]WorksheetFunction.Replace "-" with "" (in column I or "License") ?????? -I wrote this just as an example (not that I thought it would work in vba)[/COLOR]
Next oCell
Last edited: