• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Excel Vba Code

Code:
Sub InsrtNumbers()

    Dim i As Integer
    Dim cell As Range
   
    For i = 1 To 10
   
        Range(("A" & i), Range("A10")).Select
       
        For Each cell In Selection
       
            cell.Value = cell.Value & i
           
        Next cell
       
    Next i
   
End Sub
 
Hi !

First format your column as text …
No really need a code as you can achieve this with an easy formula …
And within a VBA code, the formula avoids a loop, needs only one codeline !

The better explanation, the better answer …
 
For me its giving answer

1
12
123
1234
12345
123456
1234567
12345678
123456789
12345678910

you can try the code in sheet2 or sheet 3 in the attached workbook
before running the code Clear Range from A1 to A10
 

Attachments

  • NumMacro.xlsm
    13.4 KB · Views: 4
Back
Top