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

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,215,679
Messages
6,126,177
Members
449,296
Latest member
tinneytwin

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