Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

if cell is empty

Posted on 2014-08-08
2
Medium Priority
?
116 Views
Last Modified: 2014-08-08
There are numerous replies on EE for this but not the exact one I need.

If A2 is blank I want to put out a message to say cell is blank and then I want to Exit Sub.

If A2 is not blank I need to continue to the next piece of code.

I have code tosay if blank but I can't sus out how to put out the message and then move to next piece of code.

Thanks
0
Comment
Question by:Jagwarman
2 Comments
 
LVL 54

Accepted Solution

by:
Rgonzo1971 earned 2000 total points
ID: 40248407
Hi,

maybe

Sub YourCode()
'first part of your code

if Range("A2") = "" Then
    MsgBox "Cell is blank"
    Exit Sub

End If

'second part of your code

End Sub

Regards
0
 

Author Comment

by:Jagwarman
ID: 40248413
so easy I must have tried every combination except that one Doh! Thanks
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question