VBA Check for interior cell color before close

Pinaceous

Well-known Member
Joined
Jun 11, 2014
Messages
1,113
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I'm working with a
VBA Code:
Private Sub Workbook_Close()
code, where I would like to provide the code to check for an interior cell color red in the range of B11:AI180.

I was experimenting with the following but I cannot make it work.

VBA Code:
Dim response As VbMsgBoxResult
response = MsgBox("Highlighted cells are found on your sheet.  Do you want them to be corrected", vbYesNo)

   If response = vbYes Then
    MsgBox "Please make the corrections."
  Exit Sub

   If response = vbNo Then
     'MsgBox "Continues to close document."
   Exit Sub

End If

Do you think you can help?

Many thanks!
-Pinaceous
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Glad it works for you and thank you very much for letting us know.
Good Luck
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,583
Members
449,089
Latest member
Motoracer88

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