Forum Discussion

katie_lacy's avatar
katie_lacy
Copper Contributor
Jul 11, 2019
Solved

Continue Pattern (includes letters and numbers)

I'd like to continue this pattern on this spreadsheet, but every time I try to drag it it will repeat the pattern (A, B, C, D, A, B, C, D) instead of continuing with the alphabet (A, B, C, D, E, F, G...).

 

I've been manually typing them all in, which just doesn't work for me. All the formulas I've tried looking up are for just letters or just numbers, nothing that includes both.

  • katie_lacy

     

    Hi,

     

    Please put this formula in the first cell, then drag it to the right and all the way down.

    =ROW(A21)&RIGHT(B$1)

     

    It's done by depending on the letters in the headers (Column A, Column B, etc) as a reference in the formula.

     

    Hope that helps

     

4 Replies

  • katie_lacy 

    Here is a macro that will do the needful, as long as you don't need more than 26 letters.

     

    Put the starting value in the first cell, then select the range you want filled and run the macro.

     

    Sub FillAlphaSeries()
    'Appends successive alphabetic characters to each cell in a selection. _
    The first cell in selection will retain its original value. Each sucessive cell will increment the rightmost character code by 1. _
    In so doing, you can create a series like 21A, 21B, 21C.
    Dim cel As Range, rg As Range
    Dim root As String
    Dim i As Long
    Set rg = Selection
    root = rg.Cells(1).Value
    i = Asc(Right(root, 1))
    root = Left(root, Len(root) - 1)
    For Each cel In rg.Cells
    cel.Value = root & Chr(i)
    i = i + 1
    Next

    End Sub

  • Haytham Amairah's avatar
    Haytham Amairah
    Silver Contributor

    katie_lacy

     

    Hi,

     

    Please put this formula in the first cell, then drag it to the right and all the way down.

    =ROW(A21)&RIGHT(B$1)

     

    It's done by depending on the letters in the headers (Column A, Column B, etc) as a reference in the formula.

     

    Hope that helps

     

  • Twifoo's avatar
    Twifoo
    Silver Contributor
    Try this formula in A1 and copy to your range:
    =ROW()+20&
    SUBSTITUTE(ADDRESS(1,
    COLUMN(),4),
    1,””)

Resources