If Condition is True Then Paste Named Range

bkg73123

New Member
Joined
Sep 11, 2013
Messages
8
Hello,



Please help.
I have been searching all over and found some VBA examples, but I am not good with VBA.
I would prefer formula solution.


Example:
I have two named ranges on Sheet 2 called "Range1" & "Range2".
Sheet 1 Column A are the trigger cells.
If A1 has a value of 1 I need the named range "Range1" to automatically be pasted into cell B1.
Conversely, if A1 has a value of 2 I need the named range "Range2" to automatically be pasted into cell B1.

Thank you,
B
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
You can't paste a range with a formula. What you can do is use an if array formula, but it only references the range.
Here I have two ranges the left set of numbers i DRange, the right is DRange2 you can see the array formulas and the result.


Excel 2010
ABCDE
126
27
38
49
510
6
7
8
9
1016
1157
1238
1349
14510
Sheet3
Cell Formulas
RangeFormula
B1:B5{=IF($A$1=1,DRange,IF($A$1=2,DRange2,""))}
Press CTRL+SHIFT+ENTER to enter array formulas.
Named Ranges
NameRefers ToCells
DRange=Sheet3!$D$10:$D$14
DRange2=Sheet3!$E$10:$E$14
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,272
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top