#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default range shift

Hello,
I have a strange question.

I have a sheet. call it test1
I have a range of a table. lets say B4 to G20. named "MyTable"
I have a range in the column C named "myCcolumn"

If I do this

Set TempRange = Worksheets("test1").Range("MyCColumn")
level_number = TempRange.Column

then level_number = 3. because its C


If I loop rows through the table. If I want to read the level_number
column, I will be off.
Because I am getting the column based on the sheet. not based on the table.

I tried to get the column number like this

Worksheets("test1").range("MyTable").Range("MyCCol umn")
but excel does not like this.

Is there a way to get the column based on the MyTable area?

thank for any help.






  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default range shift

Try with another range..within the table..Say

With Worksheets("sheet1")
MsgBox .Range("F1").Column - .Range("MyTable").Column + 1
End With


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


"greg" wrote:

thank,
But I would like to do it without adding the 1 shift.

is there a way to do range in this range ?
somehow?



"Jacob Skaria" wrote in message
...
Do you mean column number with reference to the table

With Worksheets("Test1")
MsgBox .Range("MyCColumn").Column - .Range("MyTable").Column + 1
End With

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


"greg" wrote:

Hello,
I have a strange question.

I have a sheet. call it test1
I have a range of a table. lets say B4 to G20. named "MyTable"
I have a range in the column C named "myCcolumn"

If I do this

Set TempRange = Worksheets("test1").Range("MyCColumn")
level_number = TempRange.Column

then level_number = 3. because its C


If I loop rows through the table. If I want to read the level_number
column, I will be off.
Because I am getting the column based on the sheet. not based on the
table.

I tried to get the column number like this

Worksheets("test1").range("MyTable").Range("MyCCol umn")
but excel does not like this.

Is there a way to get the column based on the MyTable area?

thank for any help.










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
Automatically shift chart data range Sean Clayton Excel Discussion (Misc queries) 4 April 22nd 10 10:55 PM
range shift Jacob Skaria Excel Programming 1 May 7th 09 05:20 AM
Range.Delete Shift causing merged cells to unmerge MichaelDavid Excel Programming 4 October 13th 08 08:27 PM
Shift constant values in a range left or right by n columns Dirk Goldgar Excel Programming 2 July 21st 08 07:09 PM
How can I shift cell range contents by using a function? spydog27 Excel Worksheet Functions 1 December 23rd 04 08:40 AM


All times are GMT +1. The time now is 10:54 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"