VBA - Quick question

Nordicrx8

Board Regular
Joined
Dec 10, 2015
Messages
143
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

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
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,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

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