keith05281967
Board Regular
- Joined
- May 6, 2011
- Messages
- 68
Greetings,
I'm using a Replace function ***in vba code*** to remove a word from a file name and it works perfectly. Can I have 2 conditions in a Replace function?
currently:
sFile = Replace(sFile, "Bob.", "")
below is my attempt to add a second condition....vbe didn't like my syntax.
sFile = Replace(sFile, "Bob.", "") Or Replace(sFile, "Bob_", "")
Sometimes the word to be removed is followed w/ a period and sometimes an underscore, but either way i want to remove it.
excel 07
thanks,
Keith
I'm using a Replace function ***in vba code*** to remove a word from a file name and it works perfectly. Can I have 2 conditions in a Replace function?
currently:
sFile = Replace(sFile, "Bob.", "")
below is my attempt to add a second condition....vbe didn't like my syntax.
sFile = Replace(sFile, "Bob.", "") Or Replace(sFile, "Bob_", "")
Sometimes the word to be removed is followed w/ a period and sometimes an underscore, but either way i want to remove it.
excel 07
thanks,
Keith