Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Can column character be added?

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...


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Can column character be added?

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


"jimmy" wrote:

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...



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Can column character be added?

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.

--
Regards,
Tom Ogilvy


"jimmy" wrote:

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...



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sum a column correctly after more info is added by sorting Soulscream Excel Worksheet Functions 9 January 22nd 09 08:53 PM
added unwanted data in column daisydawg New Users to Excel 1 December 27th 08 09:55 PM
Determine if Row/Column was Added/Deleted JLGWhiz Excel Programming 1 December 10th 06 10:29 PM
How can I get auto sum of column when new figures are added Dave New Users to Excel 2 July 18th 06 05:21 PM
Associate External Data with an added column cujimm Excel Discussion (Misc queries) 1 December 9th 05 03:59 PM


All times are GMT +1. The time now is 09:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"