PC Review


Reply
Thread Tools Rate Thread

Choosing a drop-down menu selection returns value to another cell

 
 
Mica
Guest
Posts: n/a
 
      19th Mar 2010
Version: Excel 2003

I have a worksheet that is referencing the value of the active cell. The
point is to provide users with dynamic details of the project they currently
have selected (active cell). I have the following worksheet code to return
the value of the active cell to A1 and the row# of the active cell to A2.
Lookup formulas search a database for detail matches on the value of the
active cell.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("A1") = Target.Value
Range("A2") = Target.Row
End Sub

The range A20:A500 has data validation to allow a list located in another
worksheet. The code to return the row of the active cell works fine, but the
value of the active cell is not returned to A1 when I select from the
drop-down menu. It is only returned once I leave that active cell and come
back to it. In other words, it is not dynamically returning the value of the
active cell when the value of the active cell changes from blank to a
selection from the drop-down list. It is only dynamic when toggling the
active cell between non-blank cells.

Ideally, I would like the code to return the value of the active cell to A1
as soon as the drop-down selection is made, before leaving the active cell.
I'm not sure if this is considered an event.

The worksheet event is Selection_Change. Is returning an offset value of
the row # an option?

Thank you,
Mica
 
Reply With Quote
 
 
 
 
Barb Reinhardt
Guest
Posts: n/a
 
      20th Mar 2010
What do you have in your worksheet_Change event at this point? Anything?
--
HTH,

Barb Reinhardt



"Mica" wrote:

> Version: Excel 2003
>
> I have a worksheet that is referencing the value of the active cell. The
> point is to provide users with dynamic details of the project they currently
> have selected (active cell). I have the following worksheet code to return
> the value of the active cell to A1 and the row# of the active cell to A2.
> Lookup formulas search a database for detail matches on the value of the
> active cell.
>
> Private Sub Worksheet_SelectionChange(ByVal Target As Range)
> Range("A1") = Target.Value
> Range("A2") = Target.Row
> End Sub
>
> The range A20:A500 has data validation to allow a list located in another
> worksheet. The code to return the row of the active cell works fine, but the
> value of the active cell is not returned to A1 when I select from the
> drop-down menu. It is only returned once I leave that active cell and come
> back to it. In other words, it is not dynamically returning the value of the
> active cell when the value of the active cell changes from blank to a
> selection from the drop-down list. It is only dynamic when toggling the
> active cell between non-blank cells.
>
> Ideally, I would like the code to return the value of the active cell to A1
> as soon as the drop-down selection is made, before leaving the active cell.
> I'm not sure if this is considered an event.
>
> The worksheet event is Selection_Change. Is returning an offset value of
> the row # an option?
>
> Thank you,
> Mica

 
Reply With Quote
 
Mica
Guest
Posts: n/a
 
      22nd Mar 2010
Hi Barb,

So far I only have the code to return the active cell value to A1 and the
active row # to A2:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("A1") = Target.Value
Range("A2") = Target.Row
End Sub

When I select from the drop-down list, it doesn't populate A1 immediately.
A1 remains blank until I leave the active cell and come back to it, then it
works.

Thanks for any suggestions.

- Mica

"Barb Reinhardt" wrote:

> What do you have in your worksheet_Change event at this point? Anything?
> --
> HTH,
>
> Barb Reinhardt
>
>
>
> "Mica" wrote:
>
> > Version: Excel 2003
> >
> > I have a worksheet that is referencing the value of the active cell. The
> > point is to provide users with dynamic details of the project they currently
> > have selected (active cell). I have the following worksheet code to return
> > the value of the active cell to A1 and the row# of the active cell to A2.
> > Lookup formulas search a database for detail matches on the value of the
> > active cell.
> >
> > Private Sub Worksheet_SelectionChange(ByVal Target As Range)
> > Range("A1") = Target.Value
> > Range("A2") = Target.Row
> > End Sub
> >
> > The range A20:A500 has data validation to allow a list located in another
> > worksheet. The code to return the row of the active cell works fine, but the
> > value of the active cell is not returned to A1 when I select from the
> > drop-down menu. It is only returned once I leave that active cell and come
> > back to it. In other words, it is not dynamically returning the value of the
> > active cell when the value of the active cell changes from blank to a
> > selection from the drop-down list. It is only dynamic when toggling the
> > active cell between non-blank cells.
> >
> > Ideally, I would like the code to return the value of the active cell to A1
> > as soon as the drop-down selection is made, before leaving the active cell.
> > I'm not sure if this is considered an event.
> >
> > The worksheet event is Selection_Change. Is returning an offset value of
> > the row # an option?
> >
> > Thank you,
> > Mica

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic Return When Choosing Drop Down Menu Sleection lean cost man Microsoft Excel Programming 3 7th Jul 2008 04:43 PM
Drop dwn menu. Formula to count selection frm menu in anoth cell? ggoldber Microsoft Excel Worksheet Functions 1 4th Jun 2008 02:21 PM
Populate Multiple cells when choosing one selection from drop down MMANDIA Microsoft Excel Misc 9 3rd Dec 2007 11:54 AM
Drop down that returns to the last selection and can be formated. =?Utf-8?B?SHVza2VyODc=?= Microsoft Excel Misc 1 19th Sep 2006 02:13 AM
Hiding a cell's drop-down menu, dependent on a tick-box selection... mintos Microsoft Excel Misc 2 13th Feb 2006 03:56 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:28 AM.