Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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
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
selecting from dropdown--have related info auto carry over Susan Excel Worksheet Functions 2 August 17th 07 02:07 PM
Running Macros by selecting from a dropdown list FionaR Excel Discussion (Misc queries) 3 January 3rd 07 01:24 PM
result of selecting from the dropdown list should be a dropdown list No News Excel Worksheet Functions 0 July 5th 06 04:09 PM
result of selecting from the dropdown list should be a dropdown list No News Excel Worksheet Functions 2 July 1st 06 10:53 AM
Selecting sheet after Userform Denny Behnfeldt Excel Programming 5 February 18th 04 03:41 AM


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