Solved

Excel VBA - Refresh Modeless Userform

Posted on 2014-04-21
4
3,369 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
  • 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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Insert Column Macro 3 38
increment numbers by 10 11 28
Excel printing page management 2 19
Auto Adjust Percent rate 5 26
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,…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

914 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now