Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default How to Find the Column address from a Range Dimensioned Variable

I am trying to use a Range demensioned variable as a column address in a
..Cells(... command to give another variable a cell address.

It Looks a little Like THis

DescriptionP3 = Sheets("5-year Plan").Cells(LoopedRowFrom, GeneralDisc.Column)

I am Fairly certain that the problem is with the GeneralDisc variable.

Thanks for all Suggestions
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default How to Find the Column address from a Range Dimensioned Variable

Hope the below examples will help. .Column and .Row returns the column and
row of the first column and first row in the range

Example :
Set myRange = Range("A1:E20")
myRange.Column will return 1
myRange.Row will return 1

Set myRange = Range("E1:E20")
myRange.Column will return 5
myRange.Row will return 1


If this post helps click Yes
---------------
Jacob Skaria


"Ironhydroxide" wrote:

I am trying to use a Range demensioned variable as a column address in a
.Cells(... command to give another variable a cell address.

It Looks a little Like THis

DescriptionP3 = Sheets("5-year Plan").Cells(LoopedRowFrom, GeneralDisc.Column)

I am Fairly certain that the problem is with the GeneralDisc variable.

Thanks for all Suggestions

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default How to Find the Column address from a Range Dimensioned Variab

FOund out myself, (yours sounded a little too bookish)


With GeneralDisc
.Select
BetweenGeneral = ActiveCell.Column
End With

DescriptionP3 = Sheets("5-year Plan").Cells(LoopedRowFrom, BetweenGeneral)

I didnt realize that i had to go through another step to do this. i figured
it could calculate it in the .Cells( , ) command.

"Jacob Skaria" wrote:

Hope the below examples will help. .Column and .Row returns the column and
row of the first column and first row in the range

Example :
Set myRange = Range("A1:E20")
myRange.Column will return 1
myRange.Row will return 1

Set myRange = Range("E1:E20")
myRange.Column will return 5
myRange.Row will return 1


If this post helps click Yes
---------------
Jacob Skaria


"Ironhydroxide" wrote:

I am trying to use a Range demensioned variable as a column address in a
.Cells(... command to give another variable a cell address.

It Looks a little Like THis

DescriptionP3 = Sheets("5-year Plan").Cells(LoopedRowFrom, GeneralDisc.Column)

I am Fairly certain that the problem is with the GeneralDisc variable.

Thanks for all Suggestions

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
pass named range address into variable okrob Excel Programming 7 March 22nd 07 07:44 PM
Using variable for range address dr chuck Excel Programming 4 May 26th 06 01:08 AM
select range and put range address in variable [email protected] Excel Programming 2 January 25th 06 01:28 AM
How do you get a Selected Range address into a variable? Jack Excel Programming 5 November 20th 03 04:09 AM


All times are GMT +1. The time now is 01:57 PM.

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"