+ Reply to Thread
Results 1 to 9 of 9

Reset Combox on Workbook Closing

  1. #1
    Forum Contributor
    Join Date
    07-07-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    500

    Reset Combox on Workbook Closing

    Greetings,
    I am using the following code to reset the combo boxes when I deactivate the worksheet and it works.
    Please Login or Register  to view this content.
    I am needing to reset the combo boxes when the workbook is closed as well - the workbook may be closed from this worksheet. I have tried the following code, but it does not reset the combo boxes.
    Please Login or Register  to view this content.
    I have also tried ComboBox1.Clear and it still does not reset the combo boxes.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Reset Combox on Workbook Closing

    Your code needs to go into the "This Workbook" Macro Module.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Contributor
    Join Date
    07-07-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    500

    Re: Reset Combox on Workbook Closing

    mehmetcik,
    I have Private Sub Workbook_Deactivate() in the "This Workbook" module.

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Reset Combox on Workbook Closing

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    07-07-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    500

    Re: Reset Combox on Workbook Closing

    mehmetcik,
    Thank you for your patience!
    I had to modify your code by removing ".ActiveSheet". It still does not work. However, it works on Private Sub Workbook_Open(). I hope this can get resloved, or I will spend my weekend trying to figure it out....
    Please Login or Register  to view this content.

  6. #6
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Reset Combox on Workbook Closing

    Just a casual observation.
    Could it be as simple as ????

    With Worksheets("Summary_Report") OR With Worksheets("Summary Sheet")

  7. #7
    Valued Forum Contributor dotchiejack's Avatar
    Join Date
    05-21-2015
    Location
    Antwerp,Belgium
    MS-Off Ver
    2016
    Posts
    507

    Re: Reset Combox on Workbook Closing

    What about this?
    Code goes in the ThisWorkbook module.
    Please Login or Register  to view this content.
    Click the * Add Reputation below to say thanks.

  8. #8
    Forum Contributor
    Join Date
    07-07-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    500

    Re: Reset Combox on Workbook Closing

    dotchiejack,
    Thank you much!! It works perfectly!!
    torachan,
    You were correct as well!

  9. #9
    Valued Forum Contributor dotchiejack's Avatar
    Join Date
    05-21-2015
    Location
    Antwerp,Belgium
    MS-Off Ver
    2016
    Posts
    507

    Re: Reset Combox on Workbook Closing

    Glad to help and thanks for the rep.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. reset filter when closing a workbook
    By ldurham in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-06-2016, 03:53 PM
  2. Reset Filters when closing or opening excel
    By Millie34 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-11-2016, 09:06 AM
  3. Excel 2013 not closing after closing workbook
    By SBennett212 in forum Excel General
    Replies: 4
    Last Post: 04-04-2015, 11:07 AM
  4. Creating new workbook, saving as csv and then closing - but closing always fails.
    By ella626 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-28-2014, 10:05 PM
  5. User Form combox populate from hidden workbook
    By jprlimey in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-27-2014, 11:33 AM
  6. Update Combox with Slicer items - getting error on Combox.listcount
    By Bigkx06 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-12-2014, 02:47 PM
  7. [SOLVED] Reset alerts when closing workbook?
    By Brian Delaney in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-21-2005, 11:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1