?
Solved

Excel VBA - Refresh Modeless Userform

Posted on 2014-04-21
4
Medium Priority
?
4,057 Views
Last Modified: 2014-04-21
I have created a modeless userform that loads spreadsheet data when it initialises.  If the spreadsheet is edited with the form open i would like the data in the userform to update.  Is simply adding a "refresh" button on the form (that effectively closes and reopens it) the way to go or is a worksheet change event better?
Chart-Userform.xlsm
0
Comment
Question by:JohnNZExcel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 40012352
It depends how live you want it to be. A Worksheet_Change event will keep the data more up to date than a button.
0
 

Author Comment

by:JohnNZExcel
ID: 40012362
Thanks for your interest in the Question.  The actual project worksheet has approximately 100 drop down boxes that are used for building a session plan and each change will slightly alter the content of the information and chart that is loaded on the userform.  I think a button will spare the system resources and make the spreadsheet work faster.  What do you think?
Assuming a "refresh" button is the way to go - do you think unloading and then re-opening the form to run the initialize code is the simplest method or can i attach the initialize code to a simple command button on the form and get the same effect?
0
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 2000 total points
ID: 40012555
If you need to run the complete code, just call Userform_Initialize from the button click directly. If not, move the code you do need into a separate routine and call that from both the Initialize event and the button Click event.
0
 

Author Comment

by:JohnNZExcel
ID: 40013795
Great, thanks for your assistance
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question