Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Edit single character within a variable

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Edit single character within a variable

Try this.

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

rickdogg03 wrote:
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Edit single character within a variable

Thanks LenB! I didn't even know about the built-in Mid function.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Format single character alex Excel Worksheet Functions 4 April 17th 09 12:50 PM
How to edit column data so that all but left most character remain Max Prophet Excel Discussion (Misc queries) 1 June 29th 06 06:18 PM
LEN fuction to leave a single character Jonah Excel Worksheet Functions 6 March 22nd 06 03:32 PM
how do I make single character as a variable in an array Hazlgrnguy Excel Worksheet Functions 1 September 25th 05 08:12 AM
Excel Macro to edit and delete one character in a cell David Excel Programming 5 December 8th 04 12:02 PM


All times are GMT +1. The time now is 01:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"