PC Review


Reply
Thread Tools Rate Thread

c.column returns a number - I need an "A" or "B" or...

 
 
HH
Guest
Posts: n/a
 
      30th Jan 2008
Hi'

I write:

top_of_area = 2

for each c in range("C9:L9")
name_of_column = c.column 'HERE I NEED AN ALFABET ANSWER NOT NUMBER
row_number = c.row -1
c.value = "=sum(" & name_of_column & top_of_area & name_of_column &
row_number & ")"
next


This only gives me the number which I cant use when I'm trying to make
at "=sum..." in the cell for later work.

Is there an easyer way?

....or just a working way?

 
Reply With Quote
 
 
 
 
Jon Peltier
Guest
Posts: n/a
 
      30th Jan 2008
There's probably an easier way, but it's not clear what you're doing
downstream. This quick and dirty formula gives you the column letter:

name_of_column = split(c.address,"$")(1)

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"HH" <(E-Mail Removed)> wrote in message
news:0d84ca03-b2d1-4bf9-bbd1-(E-Mail Removed)...
> Hi'
>
> I write:
>
> top_of_area = 2
>
> for each c in range("C9:L9")
> name_of_column = c.column 'HERE I NEED AN ALFABET ANSWER NOT NUMBER
> row_number = c.row -1
> c.value = "=sum(" & name_of_column & top_of_area & name_of_column &
> row_number & ")"
> next
>
>
> This only gives me the number which I cant use when I'm trying to make
> at "=sum..." in the cell for later work.
>
> Is there an easyer way?
>
> ...or just a working way?
>



 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      30th Jan 2008
How about:

activesheet.range("C9:L9").formular1c1 = "=sum(r2c:r[-1]c)"

In R1C1 reference style:
r2c means row 2 of the same column
r[-1]c means the row above the cell of the same column


HH wrote:
>
> Hi'
>
> I write:
>
> top_of_area = 2
>
> for each c in range("C9:L9")
> name_of_column = c.column 'HERE I NEED AN ALFABET ANSWER NOT NUMBER
> row_number = c.row -1
> c.value = "=sum(" & name_of_column & top_of_area & name_of_column &
> row_number & ")"
> next
>
> This only gives me the number which I cant use when I'm trying to make
> at "=sum..." in the cell for later work.
>
> Is there an easyer way?
>
> ...or just a working way?


--

Dave Peterson
 
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
Field Names: "LongName", "ShortName", "Code", "Description","Comments" PeteCresswell Microsoft Access 2 25th Feb 2009 11:41 PM
<FORM METHOD="post" onSubmit="return fieldcheck()" name="orientation" action="http://ws-kitty.BU.edu/AT/survey/orientation/script/write.asp" language="JavaScript"> Joeyej Microsoft ASP .NET 0 4th Jun 2004 08:55 PM
Manual "Windows Update" produces "ActiveX/active scripting" error message even with "LOW" security level setting in "Trusted" Zone Ray2 Windows XP Help 1 14th Nov 2003 06:50 PM
dr("field").toString returns "400.0000" instead of "400" Dan C Douglas Microsoft ASP .NET 5 22nd Jul 2003 06:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:27 AM.