Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Find ActiveCell.column

When I use the Activecell.column statement it returns a numeric value for the
column(ex: 27), I want the character value (ex: AA).

Here is a sample of my code, I always want to access row #1, but the column
will vary based on the activecell location:

Dim sColumn as string
Dim sRangeName as string
Dim sValue as string

sColumn = activecell.column
sRangeName = sColumn + "1"
sValue = worksheets("sheet1").range(sRangeName).value



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Find ActiveCell.column

Hi
just a question: For what do you need this?

--
Regards
Frank Kabel
Frankfurt, Germany

"LindaMac" schrieb im Newsbeitrag
...
When I use the Activecell.column statement it returns a numeric value

for the
column(ex: 27), I want the character value (ex: AA).

Here is a sample of my code, I always want to access row #1, but the

column
will vary based on the activecell location:

Dim sColumn as string
Dim sRangeName as string
Dim sValue as string

sColumn = activecell.column
sRangeName = sColumn + "1"
sValue = worksheets("sheet1").range(sRangeName).value




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Find ActiveCell.column

Linda

See here

http://www.dicks-blog.com/excel/2004..._numbers_.html to convert
column numbers to letter.

For your situation, you might use the Cells method

sValue = Worksheets("sheet1").Cells(1,ActiveCell.Column).Va lue

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"LindaMac" wrote in message
...
When I use the Activecell.column statement it returns a numeric value for

the
column(ex: 27), I want the character value (ex: AA).

Here is a sample of my code, I always want to access row #1, but the

column
will vary based on the activecell location:

Dim sColumn as string
Dim sRangeName as string
Dim sValue as string

sColumn = activecell.column
sRangeName = sColumn + "1"
sValue = worksheets("sheet1").range(sRangeName).value





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Find ActiveCell.column

That would be the hard way to do it


Dim lColumn as long
Dim sValue as string

lColumn = activecell.column
sValue = worksheets("sheet1").Cells(1, lColumn + 1).value


or

sValue = Worksheets("sheet1").Cells(1,ActiveCell.Column).Va lue

--
Regards,
Tom Ogilvy


"LindaMac" wrote in message
...
When I use the Activecell.column statement it returns a numeric value for

the
column(ex: 27), I want the character value (ex: AA).

Here is a sample of my code, I always want to access row #1, but the

column
will vary based on the activecell location:

Dim sColumn as string
Dim sRangeName as string
Dim sValue as string

sColumn = activecell.column
sRangeName = sColumn + "1"
sValue = worksheets("sheet1").range(sRangeName).value





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Find ActiveCell.column

to be precise
sValue = Worksheets("sheet1").Cells(1,ActiveCell.Column).Va lue
should be

sValue = Worksheets("sheet1").Cells(1,ActiveCell.Column + 1).Value

--
Regards,
Tom Ogilvy

"Tom Ogilvy" wrote in message
...
That would be the hard way to do it


Dim lColumn as long
Dim sValue as string

lColumn = activecell.column
sValue = worksheets("sheet1").Cells(1, lColumn + 1).value


or

sValue = Worksheets("sheet1").Cells(1,ActiveCell.Column).Va lue

--
Regards,
Tom Ogilvy


"LindaMac" wrote in message
...
When I use the Activecell.column statement it returns a numeric value

for
the
column(ex: 27), I want the character value (ex: AA).

Here is a sample of my code, I always want to access row #1, but the

column
will vary based on the activecell location:

Dim sColumn as string
Dim sRangeName as string
Dim sValue as string

sColumn = activecell.column
sRangeName = sColumn + "1"
sValue = worksheets("sheet1").range(sRangeName).value







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
Set ActiveCell at the first column of the same row... Dave Excel Discussion (Misc queries) 2 April 16th 09 08:03 PM
How To Find If The ActiveCell Is Protected FARAZ QURESHI Excel Discussion (Misc queries) 7 April 13th 09 05:03 PM
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
Activecell.FormulaR1C1 Versus ActiveSheet.cells(column, row) Ashish Shridharan Excel Programming 2 February 15th 04 04:46 PM
Use of Selection.Find & ActiveCell Steve Slechta[_2_] Excel Programming 4 November 19th 03 02:07 PM


All times are GMT +1. The time now is 08:21 AM.

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

About Us

"It's about Microsoft Excel"