Clear Cell on Open and Close Not Working

londonparisrome

New Member
Joined
Aug 1, 2019
Messages
25
I have an Excel hosted on my OneDrive that needs to be cleared on open and close. It has a drop-down of student names for parents to check status of their student's activities. I have entered the following code, but it is not clearing the student name.
VBA Code:
Private Sub Workbook_Open()
     Application.EnableEvents = False
     Worksheets("Status").Range("E5").Value = ""
     Application.EnableEvents = True
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
     Worksheets("Status").Range("E5").Value = ""
End Sub

Any suggestions?
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
I don't believe that VBA runs on files in OneDrive (at least that is what I have seen/read).
I think they may need to be on a local drive.
 
Upvote 0
I don't believe that VBA runs on files in OneDrive (at least that is what I have seen/read).
I think they may need to be on a local drive.
Bummer. Are there any solutions for a OneDrive file? I really don't want the last student's name and status left on the screen for the next parent.
 
Upvote 0
Bummer. Are there any solutions for a OneDrive file? I really don't want the last student's name and status left on the screen for the next parent.
Here are some articles you may want to check out:
 
Upvote 0

Forum statistics

Threads
1,215,364
Messages
6,124,509
Members
449,166
Latest member
hokjock

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