Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Set ActiveCell at the first column of the same row... | Excel Discussion (Misc queries) | |||
How To Find If The ActiveCell Is Protected | Excel Discussion (Misc queries) | |||
If activecell.column = variable then activecell,offset (0,1) | Excel Discussion (Misc queries) | |||
Activecell.FormulaR1C1 Versus ActiveSheet.cells(column, row) | Excel Programming | |||
Use of Selection.Find & ActiveCell | Excel Programming |