Edit single character within a variable

R

rickdogg03

The solution to this is probably quite easy, however, I'm new to the
whole world of Excel Programming with VBA. Here's the situation:

User makes an input. The input is always in the same format and is
assigned to a variable called AppID. The format of the input is
xxx-xxxxx-xx, where x can be any combination of letters and numbers.
How do I do this: If the 5th character from the left of AppID is equal
to 0, then I want to create a new variable, called AppID2, but the 5th
character of AppID2 will be changed from 0 to V.

Any help is much appreciated!

Rick
 
L

LenB

Try this.

If Mid(AppID, 5, 1) = "0" Then
AppID2 = AppID
Mid(AppID2, 5, 1) = "V"
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top