Autofill A B C D...AA AB...

cmendes

Board Regular
Joined
Jan 24, 2011
Messages
66
Hello,

I remember that excel could complete a sequence is we gave it the first elements.
In this case I'm writing in three different cells (same column) A, B C and I want excel to do the rest as I drag it down: D E F and so on. But if do it I get A B C again...
Is there anything that i have to do??
I'm using Excel for mac 2011
Thanks in advance,
C
 
Here is my take on it -- provides letter strings up to "ZZZZ":
A correction to my previously posted formula:

=SUBSTITUTE(CHAR((ROWS(A$1:A1)>18278)*(MOD(FLOOR(ROWS(A$1:A1)-703,17576)/17576-1,26)+1)+64)&CHAR((ROWS(A$1:A1)>702)*(MOD(FLOOR(ROWS(A$1:A1)-27,676)/676-1,26)+1)+64)&CHAR((ROWS(A$1:A1)>26)*(MOD(FLOOR(ROWS(A$1:A1)-1,26)/26-1,26)+1)+64)&CHAR(MOD(ROWS(A$1:A1)-1,26)+65),"@","")
 
Upvote 0

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
You could try this UDF approach
Put "A" in A1 (no quotes) and =NEXTSTRING(A1) in A2 and drag down as needed.

Code:
Function NextString(ByVal aString As String) As String
    Dim suffix As String
    If aString = vbNullString Then
        NextString = "A"
    ElseIf Right(aString, 1) = "Z" Then
        NextString = NextString(Left(aString, Len(aString) - 1)) & "A"
    Else
        Mid(aString, Len(aString), 1) = Chr(Asc(Right(aString, 1)) + 1)
        NextString = aString
    End If
End Function
 
Upvote 0
Another way:

Code:
Function ColLtr(ByVal iCol As Long) As String
    ' shg 2012
    ' Good for any positive Long
    If iCol > 0 Then ColLtr = ColLtr((iCol - 1) \ 26) & Chr(65 + (iCol - 1) Mod 26)
End Function

Function ColNum(ByVal sCol As String) As Long
    ' shg 2012
    ' Good to column FXSHRXW (2147483647)
    If Len(sCol) > 0 And _
       (Len(sCol) < 7 Or UCase(sCol) <= "FXSHRXW") Then
        ColNum = Asc(UCase(Right(sCol, 1))) - 64 _
                 + 26 * ColNum(Left(sCol, Len(sCol) - 1))
    End If
End Function

e.g., =ColLtr(337973), =ColNum("Mike")
 
Upvote 0
Excels column limit is 16384 ie XFD.

Are you really referencing outside that limit?


If i have required some products name from any sheet to excel than we write code in VB but in excel should be character From AAAAAAA to ZZZZ....... up to 26 character so we can import all data in excel.
So i have to write A,B,C,C.....AAAAAAAAA UP TO 26 CHARACTER OF A,B,C,D....

LIKE,
A
B
C
D
.
.
.
.Z
AA
AB
AC
.
.
.
AZ
AAA
AAB

.
.
.
AZZ
..
SAME LIKE UP TO WHOLE ABCD
AAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAB
.
.
.
.
ZZZZZZZZZZZZZZZZZZZZZZZZZZ
 
Upvote 0
Within the limits of the double-precision floating-point numbers used by Excel, names can have a max length of 10-letters to be able to convert bidirectionally to numbers. So you need another plan.
 
Upvote 0

Forum statistics

Threads
1,223,704
Messages
6,173,984
Members
452,540
Latest member
haasro02

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top