auto copy formulas of a named range of cells when selected

G

Guest

I wanted to have excel copy the formulas from several named range of cells to a particular location if the range name was selected from a drop down list. Let's say, cells A1:E1 are the blank cells to receive the copied formulas. Skipping a column to cell G1 is the drop down list of range names. Lastly, the named range of cells that contain the formulas I wanted automatically copied are at A10:E10, A11:E11, A12:E12 respectively. If anyone can think of a way to accomplish this, then I would appreciate your reply

Thanks, btk.
 
J

jeff

Hi,

I tried this and I think it'll do what you want: I entered
beside the ranges (A10:E10, etc) in col F10 "Range1",
F11 I entered "Range2", and F12="Range3"; I set my combo
box ("dropdown") to have the LinkedCell=G1 (hidden behind
the combo); and the ListfillRange = "F10:F12" (the names
I used for the ranges. then I added this code (rightclick
on the tab name, select view code):

Private Sub ComboBox1_Change()
Dim r As Variant
Dim s As Range
r = Application.Range("G1").Value
Set s = Application.Range(r)
s.Copy Destination:=Range("A1")
End Sub

The values in the selected range from the dropdown
are copied into A1:E1.

HOpe this is close.
jeff
-----Original Message-----
I wanted to have excel copy the formulas from several
named range of cells to a particular location if the range
name was selected from a drop down list. Let's say, cells
A1:E1 are the blank cells to receive the copied formulas.
Skipping a column to cell G1 is the drop down list of
range names. Lastly, the named range of cells that contain
the formulas I wanted automatically copied are at A10:E10,
A11:E11, A12:E12 respectively. If anyone can think of a
way to accomplish this, then I would appreciate your reply.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top