Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default 2B or not 2B? - Go to cell Bx, depending on what row is selected

Hi,
I'm no vba programmer, I can record macros, do loops etc, but I'm not
sure how/why each statement is structured the way it is.
What I want to do is store the value from a specific cell. The cell
is located in column B, and in the row of the current selection. ie,
if cell J23 is selected, I want to store the value of J2 as i. If A1
is the current selected cell, then it should be A2 which is stored as
i...

From trying to figure it out myself, i've got

i = Cells(Row.Selection, 2)
Can someone tell me where I'm going wrong?

Cheers

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 182
Default 2B or not 2B? - Go to cell Bx, depending on what row is selected

try this :
i Cells(Selection.Row, 2)

Regards,

Halim


"bony_tony" wrote:

Hi,
I'm no vba programmer, I can record macros, do loops etc, but I'm not
sure how/why each statement is structured the way it is.
What I want to do is store the value from a specific cell. The cell
is located in column B, and in the row of the current selection. ie,
if cell J23 is selected, I want to store the value of J2 as i. If A1
is the current selected cell, then it should be A2 which is stored as
i...

From trying to figure it out myself, i've got

i = Cells(Row.Selection, 2)
Can someone tell me where I'm going wrong?

Cheers


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default 2B or not 2B? - Go to cell Bx, depending on what row is selected

One way:

i = Cells(ActiveCell.Row, 2).Value


In article .com,
bony_tony wrote:

Hi,
I'm no vba programmer, I can record macros, do loops etc, but I'm not
sure how/why each statement is structured the way it is.
What I want to do is store the value from a specific cell. The cell
is located in column B, and in the row of the current selection. ie,
if cell J23 is selected, I want to store the value of J2 as i. If A1
is the current selected cell, then it should be A2 which is stored as
i...

From trying to figure it out myself, i've got

i = Cells(Row.Selection, 2)
Can someone tell me where I'm going wrong?

Cheers

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
Can I show a picture depending on what data is selected in a cell Lesley Murray Excel Discussion (Misc queries) 3 April 12th 07 04:34 PM
Cell data depending on column selected. [email protected] Excel Programming 1 May 1st 06 10:54 AM
Want add color to the cell depending on the value selected from th Tom Ogilvy Excel Programming 0 August 16th 05 07:11 PM
return a data list depending on a value selected within a drop dow loren Excel Discussion (Misc queries) 1 April 11th 05 05:17 PM
Vb Application to locate a worksheet depending on the radio box selected Shawn[_7_] Excel Programming 1 July 7th 04 08:27 PM


All times are GMT +1. The time now is 02:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"