Solved

# Char in Excel

Posted on 2014-01-29
144 Views
After Z2, I want it to be AA2, AB2, etc until AY2. Could you help?

Dim i As Integer = 1
Dim k As Integer = 1
Dim z As Integer = 50
Dim row As Integer = 2

For k = k To z
i += 1
Dim test As String = (Chr(64 + k)) & Trim(Str(row))
Next
0
Question by:VBdotnet2005
• 2

LVL 48

Accepted Solution

Rgonzo1971 earned 500 total points
Hi,

pls try

``````        For k = 1 To 125
i = i + 1
test = IIf(k >= 26, Chr(64 + (k \ 26)), "") & Chr(64 + (k Mod 26) + 1) & Trim(Str(row))
Next
``````
Regards
0

Author Comment

What is IIf?
0

LVL 48

Expert Comment

Sorry it's (not VBA) If

Regards
0

## Featured Post

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…