Error On Save

RandyD123

Active Member
Joined
Dec 4, 2013
Messages
296
Office Version
  1. 2016
Platform
  1. Windows
I keep getting an error message when I try to save this sheet. The thing is that I don't use the macro on the sheet that I am getting the error message on. I use it on the LNC tab and it works fine. I can even save if I'm on the LNC tab with no errors?? Can anyone possible help? Thank you.
 

Attachments

  • 1.png
    1.png
    29.4 KB · Views: 7
  • 2.png
    2.png
    72.4 KB · Views: 7
  • 3.png
    3.png
    37.5 KB · Views: 8

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
It may mean it cannot find what you are look for.

Try replacing that line in yellow with this code block:
VBA Code:
If b is Nothing Then
    MsgBox "Cannot find " & fndDate & " in your range"
Else
    b.Select
End If
 
Upvote 0
When posting vba code in the forum, please post the actual code, not a picture of it, so we can copy to test. Use the available code tags as it makes your code much easier to read/debug & copy. My signature block below has more details. I have added the tags for you this time. 😊

Immediately above that yellow highlighted line of code insert this code and see what it shows. Is it what you were expecting?
VBA Code:
If b Is Nothing Then
  MsgBox "B is nothing"
Else
  MsgBox b.Value
End If
 
Last edited:
Upvote 0
Thank you all for helping. I normally would have posted VBA code but I had a lot of code that I didn't think would be relevant. Anyway, I fixed by not allowing my "save code" to call on "Nearest_Date" code. The weird thing is that, that code should have only run on the LNC tab and not the Data tab. Any way thanks again for all the help.
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,623
Latest member
Techenthusiast

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