Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / November 2006

Tip: Looking for answers? Try searching our database.

VBA code for poping out an error message box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jaymai108@gmail.com - 14 Nov 2006 21:01 GMT
Anyone know the VBA code for poping out an error message box?
I am creating a worksheet where the user can enter values to certain
cells before clicking the "run" command button, and when the button is
clicked, i want it to check wheather the cells that require input are
filled, if not, then a message box will pop out saying "error"
thanks
jay
Dave Peterson - 14 Nov 2006 21:22 GMT
Option Explicit
Sub testme()
 dim myRng as range

 with activesheet
    set myrng = .range("a1,b3,c9,d12,f99")
 end with

 if myrng.cells.count <> application.counta(myrng) then
     msgbox "Please complete all the cells!
     exit sub
 end if

 'rest of code

End Sub

> Anyone know the VBA code for poping out an error message box?
> I am creating a worksheet where the user can enter values to certain
[quoted text clipped - 3 lines]
> thanks
> jay

Signature

Dave Peterson


Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.