Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 17
Default Variable Cell Reference

Hi,

I'm using a lookup function where the values in cells C2:E2 are returned
from a whichever row of a separate table matches the value of B2 (a very
simple VLOOKUP).

Instead of having B2 as an absolute value, can I enter a formula that will
make B2 equal the value of whatever cell I select? For example, if the value
of A2 is 8 and I select it, then B2 becomes 8, or if the value of A5 is 120
and I select it, then B2 becomes 120?

I may not have explained this very well, but hopefully someone might be able
to help?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default Variable Cell Reference

If you are sure that is what you want,
Right click sheet tabview codeinsert this. Now, any single cell selected
will transfer that value to b2

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("b2") = Target
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Stormy" wrote in message
...
Hi,

I'm using a lookup function where the values in cells C2:E2 are returned
from a whichever row of a separate table matches the value of B2 (a very
simple VLOOKUP).

Instead of having B2 as an absolute value, can I enter a formula that will
make B2 equal the value of whatever cell I select? For example, if the
value
of A2 is 8 and I select it, then B2 becomes 8, or if the value of A5 is
120
and I select it, then B2 becomes 120?

I may not have explained this very well, but hopefully someone might be
able
to help?

Thanks


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 17
Default Variable Cell Reference

That is exactly what I wanted to do - thanks very much!

"Don Guillett" wrote:

If you are sure that is what you want,
Right click sheet tabview codeinsert this. Now, any single cell selected
will transfer that value to b2

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("b2") = Target
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Stormy" wrote in message
...
Hi,

I'm using a lookup function where the values in cells C2:E2 are returned
from a whichever row of a separate table matches the value of B2 (a very
simple VLOOKUP).

Instead of having B2 as an absolute value, can I enter a formula that will
make B2 equal the value of whatever cell I select? For example, if the
value
of A2 is 8 and I select it, then B2 becomes 8, or if the value of A5 is
120
and I select it, then B2 becomes 120?

I may not have explained this very well, but hopefully someone might be
able
to help?

Thanks



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
cell reference as variable? Ruthie Excel Discussion (Misc queries) 17 April 26th 10 02:39 AM
Variable Cell Reference Andrew Excel Discussion (Misc queries) 3 December 29th 06 03:35 PM
vba variable value via cell reference Bill (Unique as my name) Excel Discussion (Misc queries) 3 November 29th 06 12:40 AM
problem with cell reference in =sum(offset(cell reference,x,y,z,a)). Want cell ref to be variable. [email protected] Excel Worksheet Functions 2 December 11th 04 12:05 AM
Problem with =sum(offset(cell reference,w,x,y,z). I want cell reference to be variable [email protected] Excel Worksheet Functions 2 December 11th 04 12:00 AM


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