Can column character be added?

  • Thread starter Thread starter jimmy
  • Start date Start date
J

jimmy

I use to assign value to the cells A1 B1 C1....BA1, how to do this by using
a for loop? I have tried "A" + 1 be it is not equal to B since the type
error...
 
something like this puts a number for A1 through J1 in Sheet1

Dim iColumn As Integer
For iColumn = 1 To 10
Sheet1.Cells(1, iColumn).Value = iColumn
Next iColumn
 
for each cell in Range("A1:BA1")
cell.Value = Int(rnd()*100+1)
Next

is one way

for i = 1 to 53
cells(1,i).Value = Int(rnd()*100+1)
next

is another.

For i = 0 to 52
Range("A1").offset(0,i).value = int(rnd()*100+1)
next

is yet another.
 

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