VBa to copy and paste data into a cell when a dropdown is selected

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,080
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi Everyone,

Hopefully someone has come up with this problem before and know how to deal with it but i have an idea that should work.

Hers my problem,
I have a list of dropdown options in AC11:Ac100
in X20 i have a dropdown box linked to this list

Now the problem i have is this dropdown list is unusual as some of the cell contain formulas for example lets say D17 was a name the cell might read "Message for " & D17, to show that name
but when i select from the dropdown box i get "Message for TONY" (tony being the name in D17 at the time) but I want it to give me the same formula so X20 = "Message for " & D17,

So this is what i was thinking,

I need a macro that can copy the dropdown selected and paste it into X20

So if I select "Message for TONY" from the dropdown the macro is triggered goes find "Message for TONY" in AC11:Ac100 copies and pastes it in as a formula.

now any ideas how i can do this.
(Or any other way to get the formula in would do fine )


please help if you can

Thanks

Tony
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Micron

Well-known Member
Joined
Jun 3, 2015
Messages
4,203
Office Version
  1. 365
Platform
  1. Windows
Maybe this will get you started:
VBA Code:
Sub NameOfDropDownHere_Change()
Dim dd As DropDown

Set dd = ActiveSheet.Shapes("NameOfDropDownHere").OLEFormat.Object
MsgBox ActiveSheet.Range("A" & dd.ListIndex).Formula

End Sub
Change A to whatever column contains your list values.
 

Forum statistics

Threads
1,181,673
Messages
5,931,352
Members
436,787
Latest member
ogharipour

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
Top