0% found this document useful (0 votes)
105 views

Excel - Using VBA Code To Copy Specific Value From A Cell When The Dropdown Box Changes That Value - Stack Overflow PDF

This document discusses using VBA code in Excel to copy a specific value from a cell when the scenario changes in another cell. The user has created an investment model with three scenarios that appear in a drop down list in cell H13. When the scenario is changed, various outputs on the sheet update. The user wants to create a summary table showing the value from cell E13, which contains an NPV formula, for each scenario selection. The user is looking for help writing VBA code to copy the value from cell E13 into the summary table each time the scenario is changed.

Uploaded by

agewisdom
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
105 views

Excel - Using VBA Code To Copy Specific Value From A Cell When The Dropdown Box Changes That Value - Stack Overflow PDF

This document discusses using VBA code in Excel to copy a specific value from a cell when the scenario changes in another cell. The user has created an investment model with three scenarios that appear in a drop down list in cell H13. When the scenario is changed, various outputs on the sheet update. The user wants to create a summary table showing the value from cell E13, which contains an NPV formula, for each scenario selection. The user is looking for help writing VBA code to copy the value from cell E13 into the summary table each time the scenario is changed.

Uploaded by

agewisdom
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

excel - Using VBA code to Copy Specific value from a cell when the dr... https://stackoverflow.com/questions/40734860/using-vba-code-to-copy-...

Join us in building a kind, collaborative learning community via our updated Code of Conduct.

Stack Overflow

I am new to VBA and have only


recently been developing my excel
skills.

I have created 3 different scenarios for


an investment project situation, these
scenarios appear in cell "h13" as a
drop down box with three options
being available, best case/worst
case/base case.

When you select each scenario the


various outputs will change on the
sheet and I have set up the following
code to change the outputs and
display the relevant ones according to
the scenario:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$H$13" Then
    ActiveSheet.Scenarios(Target.Value).Show
  End If

Now, what I want to achieve is the


following:

In Cell E13 I have a numeric value


that is my main concern (I should note
this is an NPV Formula). Every time
we change scenario this value
obviously changes. I would like to
create a summary table that is simply
something like this: Scenario 1 = x
Join Stack Overflow to learn, share knowledge, and build your career.
This site uses cookies to deliver our services and to show you relevant ads and job listings. By using our site, you
acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service. Your use of
Email
Stack Overflow’s Products and Sign Up
Services, OR SIGN
including IN WITH
the Stack Google is subjectFacebook
Overflow Network, to these policies and terms.

1 of 1 22/8/18, 22:00

You might also like