ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Looping Text (https://www.excelbanter.com/excel-programming/296186-looping-text.html)

Bob Myles

Looping Text
 
How can you return the next letter in a sequence

Ie

txt = a+
would equal b, then c then d etc..

Frank Kabel

Looping Text
 
Hi
maybe something like
txt=chr(asc(txt)+1)

--
Regards
Frank Kabel
Frankfurt, Germany


Bob Myles wrote:
How can you return the next letter in a sequence?

Ie:

txt = a+1
would equal b, then c then d etc..


Greg Wilson[_4_]

Looping Text
 
Assuming the current letter is derived from the active
cell:

Sub NextLetter()
Dim txt As String
txt = ActiveCell.Text
txt = Chr(Asc(txt) + 1)
MsgBox txt
End Sub

Regards,
Greg

-----Original Message-----
How can you return the next letter in a sequence?

Ie:

txt = a+1
would equal b, then c then d etc..
.


Bob Myles

Looping Text
 
Awesome! Thank you!

Bob Myles

Looping Text
 
Awesome! Thank you! I just couldn't get the syntax!! Thanks!


All times are GMT +1. The time now is 12:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com