Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
XL2002 - I'm having a bad day!
Use OFFSET
Sub useoffset() For Each c In Range("a1:a5") MsgBox c & "..." & c.Offset(, 1) Next c End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
XL2002 SUM with a twist... | Excel Worksheet Functions | |||
XL2002 - SelectionChange Question... | Excel Programming | |||
xl2002 problem | Excel Programming | |||
Using min and max function XL2002 | Excel Worksheet Functions | |||
Code suddenly won't run on XL2002 | Excel Programming |