Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default XL2002 - I'm having a bad day!

My mind is blank today...

I have a cell containing a letter. I want to use the letter to reference a
column.
I then want to reference a column 2 columns to the right of the first column.
Sounds easy, but as I said, I'm having a bad day.

Here's what I have...

Dim cell As Range

For Each cell In Sheets("Lists").Range("A1:A5")
my1stCol = cell.Value
my2ndCol = my1stCol + 2
msgbox (my1stCol & " ... " & my2ndCol)
Next

Thanks in advance.

Trevor Williams
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default XL2002 - I'm having a bad day!

Try this...

my2ndCol = cell.Offset(, 2).Value

--
Rick (MVP - Excel)


"Trevor Williams" wrote in
message ...
My mind is blank today...

I have a cell containing a letter. I want to use the letter to reference
a
column.
I then want to reference a column 2 columns to the right of the first
column.
Sounds easy, but as I said, I'm having a bad day.

Here's what I have...

Dim cell As Range

For Each cell In Sheets("Lists").Range("A1:A5")
my1stCol = cell.Value
my2ndCol = my1stCol + 2
msgbox (my1stCol & " ... " & my2ndCol)
Next

Thanks in advance.

Trevor Williams


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default XL2002 - I'm having a bad day!

Thanks guys that helps!

"Rick Rothstein" wrote:

Try this...

my2ndCol = cell.Offset(, 2).Value

--
Rick (MVP - Excel)


"Trevor Williams" wrote in
message ...
My mind is blank today...

I have a cell containing a letter. I want to use the letter to reference
a
column.
I then want to reference a column 2 columns to the right of the first
column.
Sounds easy, but as I said, I'm having a bad day.

Here's what I have...

Dim cell As Range

For Each cell In Sheets("Lists").Range("A1:A5")
my1stCol = cell.Value
my2ndCol = my1stCol + 2
msgbox (my1stCol & " ... " & my2ndCol)
Next

Thanks in advance.

Trevor Williams



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
XL2002 SUM with a twist... Trevor Williams Excel Worksheet Functions 4 December 9th 09 10:28 AM
XL2002 - SelectionChange Question... Trevor Williams Excel Programming 2 October 13th 08 02:20 PM
xl2002 problem Gary Keramidas Excel Programming 3 May 24th 07 04:18 AM
Using min and max function XL2002 Extremely Aggravated Excel Worksheet Functions 1 September 23rd 05 06:29 PM
Code suddenly won't run on XL2002 Mark Tangard[_2_] Excel Programming 0 April 27th 04 01:29 AM


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