PC Review


Reply
Thread Tools Rate Thread

Can column character be added?

 
 
jimmy
Guest
Posts: n/a
 
      9th Mar 2007
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 With Quote
 
 
 
 
=?Utf-8?B?VmVyZ2VsIEFkcmlhbm8=?=
Guest
Posts: n/a
 
      9th Mar 2007
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...
>
>
>

 
Reply With Quote
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      9th Mar 2007
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Test if Last Character in Column of Cells is Alpha Character Benjamin Microsoft Excel Programming 6 21st Sep 2009 06:36 PM
¿ character added by My.Computer.FileSystem.WriteAllText Manuel Microsoft VB .NET 6 19th Aug 2005 01:46 AM
How to new added column in the fist column ad Microsoft ASP .NET 3 8th Jun 2005 01:59 PM
whitespace character added to html email nadia Microsoft Dot NET 2 13th Jul 2004 08:19 AM
whitespace character added to html email nadia Microsoft ASP .NET 2 13th Jul 2004 08:19 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:23 PM.