Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
User selecting range from userform via dropdown menue
Hi All!
I've searched for this for a while, and have had no luck! Also, I will doe the best to explain exactly what I'm trying to do...but it might be tough...here goes! I'm using VB within Excel. From a userform, I'd like to use a drop down menue (which I already know how to do). The list would be of ranges (already set-up via insert-name- define). So, when the user selects the item, they would have selected a range in the background. Then, I'd like to copy the now selected range and paste it to a new area. This would be repeated everytime the user starts over, however, the ranges will be different depending on which range the user selects. Is it too confusing or impossible? I have tried recording a macro and using the "application.goto" option, however, all that it does is a specific range name and I could not have the user select it... Thanks in advance Matt |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
User selecting range from userform via dropdown menue
Private Sub Combobox1_Click()
Dim rng as Range On error resume Next set rng = Range(combobox1.Value) On error goto 0 if not rng is nothing then rng.copy Destination:=Range("AA1") end if End sub -- Regards, Tom Ogilvy "mslabbe" wrote in message ... Hi All! I've searched for this for a while, and have had no luck! Also, I will doe the best to explain exactly what I'm trying to do...but it might be tough...here goes! I'm using VB within Excel. From a userform, I'd like to use a drop down menue (which I already know how to do). The list would be of ranges (already set-up via insert-name- define). So, when the user selects the item, they would have selected a range in the background. Then, I'd like to copy the now selected range and paste it to a new area. This would be repeated everytime the user starts over, however, the ranges will be different depending on which range the user selects. Is it too confusing or impossible? I have tried recording a macro and using the "application.goto" option, however, all that it does is a specific range name and I could not have the user select it... Thanks in advance Matt |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
User selecting range from userform via dropdown menue
Matt,
Is it not just With Activesheet .Range(Me.Combobox1.Value).Copy Destination:=.Range("copyArea") End With from with the form -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "mslabbe" wrote in message ... Hi All! I've searched for this for a while, and have had no luck! Also, I will doe the best to explain exactly what I'm trying to do...but it might be tough...here goes! I'm using VB within Excel. From a userform, I'd like to use a drop down menue (which I already know how to do). The list would be of ranges (already set-up via insert-name- define). So, when the user selects the item, they would have selected a range in the background. Then, I'd like to copy the now selected range and paste it to a new area. This would be repeated everytime the user starts over, however, the ranges will be different depending on which range the user selects. Is it too confusing or impossible? I have tried recording a macro and using the "application.goto" option, however, all that it does is a specific range name and I could not have the user select it... Thanks in advance Matt |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
selecting from dropdown--have related info auto carry over | Excel Worksheet Functions | |||
Running Macros by selecting from a dropdown list | Excel Discussion (Misc queries) | |||
result of selecting from the dropdown list should be a dropdown list | Excel Worksheet Functions | |||
result of selecting from the dropdown list should be a dropdown list | Excel Worksheet Functions | |||
Selecting sheet after Userform | Excel Programming |