Solved

Excel VBA - Refresh Modeless Userform

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
stuck in average-1 12 65
List Box Entries Excel 2010 5 31
Word 2016 - View side-by-side displays docs vertically 2 21
Index Match Array? 5 38
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
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 the scrolling table in Microsoft Excel using the INDEX function.

837 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