Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-14-2013, 03:59 AM
thedeadzeds thedeadzeds is offline message box Windows XP message box Office 2003
Novice
message box
 
Join Date: May 2013
Posts: 5
thedeadzeds is on a distinguished road
Default message box

Guys,

I have this code and it works fine but Is there a wasy to change it to show

If d6 = "Assistance" then message box to show "J6 must be completed"
If d8 = "Assistance" then message box to show "J8 must be completed"
If d10 = "Assistance" then message box to show "J10 must be completed"
If d12 = "Assistance" then message box to show "J12 must be completed"
If d14 = "Assistance" then message box to show "J14 must be completed"



and so on and so on

Thanks
Craig


Code:

Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
 
If Worksheets("sheet1").Range("D6").Value = "OK" Then
Exit Sub
Else
MsgBox ("You need to complete the task box")
End If
 
End Sub
Reply With Quote
  #2  
Old 05-16-2013, 10:13 AM
Catalin.B Catalin.B is offline message box Windows Vista message box Office 2010 32bit
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

This one is for Excel Programming forum.
Anyway, you can try this:
Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)  Dim i As Integer
 With Worksheets("sheet1")
         For i = 6 To 14 Step 2
            If Cells(i, "D") = "Assistance" Then _
               MsgBox ("You need to complete cell J" & i)
            Next
 End With 
End Sub
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
message box Message replys are shown at the bottom of the message, how can I get them to the top Gardy Outlook 3 05-23-2012 01:20 AM
Message Box ibrahimaa Excel Programming 3 02-26-2012 02:32 PM
message box Message Header ritjohns Outlook 1 11-16-2011 01:20 PM
message box Proofing message geralds34 Word 2 05-02-2011 06:07 PM
Error message White House Outlook 1 12-07-2010 04:52 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:59 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft