VBA help

Giggzz

Well-known Member
Joined
Jul 4, 2002
Messages
990
Before Save
If Sheets("Quote").Range("K17").Value = "" And Sheets("Quote").Range ("B5:D5").Value <> "" Then
MsgBox (Range("F5").Value) & ", is this a Prevailing Wage project?", vbOKOnly, "Prevailing Wage"
Range("K17").Select
If vbOK Then Cancel = True

I cant seem to get this to fire when I add the second requirement, in bold, for the msgbx to fire. and thoughts on what the probelm might be??

Range(B5:D5) is a merged cell, which houses only text.
thanks
 

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.
I think it might be that the second range has more than 1 cell.

try range("B5") if it's a merged cell as this would be where the value is
 
Upvote 0
If Sheets("Quote").Range("K17").Value = "" And Sheets("Quote").Range ("B5").TEXT <> "" Then
MsgBox (Range("F5").Value) & ", is this a Prevailing Wage project?", vbOKOnly, "Prevailing Wage"
Range("K17").Select
If vbOK Then Cancel = True


this worked, thanks
 
Upvote 0

Forum statistics

Threads
1,213,513
Messages
6,114,064
Members
448,545
Latest member
kj9

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