LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default VBA help - error message to user

On May 14, 5:57 pm, merjet wrote:
Sub Macro1() ' or whatever name it is
Dim bTest As Boolean
bTest = FailTest
If bTest = True Then Exit Sub
' rest of code
End Sub

Private Function FailTest() As Boolean
If Range("B2") = "X" Then
If IsEmpty(Range("E1")) Or IsEmpty(Range("E2")) Or _
IsEmpty(Range("E3")) Then
MsgBox "Can't export data unless cells E1, E2, and E3 are
filled in."
FailTest = True
Else
FailTest = False
End If
End If
End Function

Hth,
Merjet


Thank you Merjet...this worked. You saved the day yet again!

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error Message if user leaves a field blank GillianX Excel Worksheet Functions 1 October 14th 08 05:40 PM
replace VBA run-time error message with custom message BEEJAY Excel Programming 13 July 14th 06 03:59 PM
changing the message in an error message The Villages DA Excel Worksheet Functions 2 February 18th 05 05:30 PM
Displaying a message in a message box without requiring user to click anything to proceed Android[_2_] Excel Programming 2 June 25th 04 06:44 PM
Asking user to print and error message Olly[_3_] Excel Programming 1 November 17th 03 01:18 PM


All times are GMT +1. The time now is 12:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"