Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro to Remove Spaces and Quotes from Multiple Part Bodies

Status
Not open for further replies.

jzecha

Aerospace
Joined
Jan 20, 2016
Messages
236
Location
US
I was on here about a year ago and had help creating a macro that would remove any specified symbol from the part body names.

The line of code i have is this:
Code:
newName = Replace(newName, ".", newCharacter) 'replace all "." with "_"

This works great, I have added multiple similar lines with to the script with other symbols, but I have run into two issues.
1.Code to change spaces to underscores:
Code:
newName = Replace(newName, " ", newCharacter) 'replace all " " with "_"

2.Code to change quotes to underscores:
Code:
newName = Replace(newName, """, newCharacter) 'replace all """ with "_"

Neither of these work, anybody have any ideas how to modify the code to get them to work?
Also, how would i modify my code to just remove specified symbol as opposed to replacing it with an underscore?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top