Open Form If value exits iin Cell

adamsm

Active Member
Joined
Apr 20, 2010
Messages
444
Hi,

The following code opens the user form on button click.
Code:
Sub ShowFrom()
frmCheck.Show vbModeless
End Sub

How could this code be further changed so that it wont open the user form if cell A2 is empty.

IF cell A2 is empty it would should show a message saying please fill cell A2

Any help would be appreciated.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Code:
Sub ShowFrom()
If Range("A2") = "" Then
    MsgBox "Please fill in cell A2"
Else
    frmCheck.Show vbModeless
End If

End Sub
 
Upvote 0

Forum statistics

Threads
1,224,557
Messages
6,179,507
Members
452,917
Latest member
MrsMSalt

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