User Tools

Site Tools


microsoft_excel:macro_create_sequence

This is an old revision of the document!


Microsoft Excel - Macro Create Sequence

Sub c_CreateSequence()
    range("A1").Select
    Selection.EntireColumn.Insert , CopyOrigin:=xlFormatFromLeftOrAbove
    range("A1").Value = "UNIQUE_ID"
    range("B1").Select
    Selection.Copy
    range("A1").Select
    Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
        SkipBlanks:=False, Transpose:=False
    range("A2").Select
    ActiveCell.FormulaR1C1 = "1"
    range("A3").Select
    ActiveCell.FormulaR1C1 = "=R[-1]C+1"
    range("A3").Select
    Selection.Copy
    range("A4:A1908").Select
    ActiveSheet.Paste
    Columns("A:A").Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
End Sub
microsoft_excel/macro_create_sequence.1605473927.txt.gz ยท Last modified: 2020/11/15 20:58 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki