Char in Excel

Posted on 2014-01-29
Last Modified: 2014-02-06
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))
Question by:VBdotnet2005
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 50

Accepted Solution

Rgonzo1971 earned 500 total points
ID: 39818725

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))

Open in new window


Author Comment

ID: 39818739
What is IIf?
LVL 50

Expert Comment

ID: 39818837
Sorry it's (not VBA) If


Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
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.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question