VBA - Quick question

Nordicrx8

Board Regular
Joined
Dec 10, 2015
Messages
144
Office Version
  1. 365
Platform
  1. Windows
Hey all!

I'm sure this is an easy one, but I'm not very familiar with VBA. Essentially I'm trying to hide a submit button until one of the two selections are made from a drop down in I8.

The below works for one phrase, but I can't figure out how to add another phrase to it.

I want it so if they select either of the following, the button will appear:

"I'm ready to submit! (This is your digital signature)"
---OR---
"I'm opting out of this round"

Here is the code that works for the first phrase. could someone help me with adding the code for the second?

thank you! :)

Private Sub Worksheet_Change(ByVal Target As Range)

With ActiveSheet
.Shapes("Button1").Visible = (.Range("I8") = "I'm ready to submit! (This is your digital signature)")

End With

End Sub
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
How about
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
   If Target.CountLarge > 1 Then Exit Sub
   If Target.Address(0, 0) = "I8" Then
      If Target.Value = "I'm ready to submit! (This is your digital signature)" Or Target.Value = "I'm opting out of this round" Then
         Me.Shapes("Button1").Visible = True
      Else
         Me.Shapes("Button1").Visible = False
      End If
   End If
End Sub
 
Last edited:
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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