Adding Select Values to Clipboard: VBA

SAMUSER

Board Regular
Joined
Jul 27, 2012
Messages
82
Hi Everyone,

I have a short script that runs perfectly fine for copying the value from a drop-down list onto the clipboard. However, there are two selections for which I don't want this to happen:

a) When the text selected says "The result has not been chosen"
b) When the text selected says "The result is not available

I see that this would be an if-else statement, with char/string match- but I am not able to code this. If any of you could provide some help, that would be fantastic! Thanks so much!

Code:
Sub copyOutcome()
Set outcomeData = New DataObject
        outcomeData.SetText Range("a16").Value    
        outcomeData.PutInClipboard
End Sub
 

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

Forum statistics

Threads
1,215,634
Messages
6,125,931
Members
449,274
Latest member
mrcsbenson

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