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

  • Thread starter Thread starter HH
  • Start date Start date
H

HH

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? :)
 
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
 
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
 

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