Macro that Fills Sequential numbers

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

As you see below I am trying to fill cells with "CSR1, CSR2..... How do I
right that without caling each cell?
Sheets("Team List").Select
Range("B2:B16").ClearContents
Range("B2").Value = "CSR1"
Range("B3").Value = "CSR2"
Range("B4").Value = "CSR3"
Range("B5").Value = "CSR4"
Range("B6").Value = "CSR5"
 
David,

Is this any good?

Sub liminal_Advertising()
Sheets("Team List").Select
x = 1
Dim myRange As Range
Set myRange = Range("B2:B16")
For Each c In myRange
c.Value = "CSR" & x
x = x + 1
Next
End Sub

Mike
 
Thank you that is just waht I needed.....

Mike H said:
David,

Is this any good?

Sub liminal_Advertising()
Sheets("Team List").Select
x = 1
Dim myRange As Range
Set myRange = Range("B2:B16")
For Each c In myRange
c.Value = "CSR" & x
x = x + 1
Next
End Sub

Mike
 
One way:

With Sheets("Team List").Range("B2")
.Value = "CSR1"
.AutoFill Destination:=.Resize(15, 1)
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top