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

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,194
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

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
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.
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,212
Members
449,074
Latest member
cancansova

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