Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default UserForm - display text message then run code

I have a UserForm which runs some code for around 2 minutes. When the
CommandButton is activated I want a short message to display in a
TextBox on the UserForm throughout the time the code is running.
Even though 'TextBox1.Text = "selection running" is placed at the
beginning the message does not appear until all the process has finished
running.
Grateful for any suggestions.
--
Robert
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 280
Default UserForm - display text message then run code

Look at DoEvents.

--
Bob Kilmer


"Robert" wrote in message
...
I have a UserForm which runs some code for around 2 minutes. When the
CommandButton is activated I want a short message to display in a
TextBox on the UserForm throughout the time the code is running.
Even though 'TextBox1.Text = "selection running" is placed at the
beginning the message does not appear until all the process has finished
running.
Grateful for any suggestions.
--
Robert



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default UserForm - display text message then run code

Robert,

One way is to use the Status Bar at the bottom of the screen.
At various places within your code you can set different messages
Application.StatusBar = "Code processing begun"
Application.StatusBar = "2nd message"
......
Application.StatusBar = False ' this resets the Status Bar

Or you can use an extra sheet with a message on it.
In your code - show the window than use
Application.ScreenUpdating = False
to freeze the view (not the code).
Set it back to True at the end of your code (and besure to hide the sheet.

An alternate is to insert the sheet and than delete it. Or create another
workbook with a message page and than close it without saving.
use
Application.DisplayAlerts = False ' reset to true at the end
than close it without saving.

Just a couple of ideas to work with.

Post back if you want more input...

--
sb
"Robert" wrote in message
...
I have a UserForm which runs some code for around 2 minutes. When the
CommandButton is activated I want a short message to display in a
TextBox on the UserForm throughout the time the code is running.
Even though 'TextBox1.Text = "selection running" is placed at the
beginning the message does not appear until all the process has finished
running.
Grateful for any suggestions.
--
Robert



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default UserForm - display text message then run code

In message , Robert writes
I have a UserForm which runs some code for around 2 minutes. When the
CommandButton is activated I want a short message to display in a
TextBox on the UserForm throughout the time the code is running.
Even though 'TextBox1.Text = "selection running" is placed at the
beginning the message does not appear until all the process has
finished running.
Grateful for any suggestions.


Many thanks for the suggestions - DoEvents has solved the problem.
--
Robert
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
NEED A MACRO CODE TO USE IN A USERFORM Rachel Excel Discussion (Misc queries) 3 November 25th 08 10:08 AM
display userform Anthony Excel Discussion (Misc queries) 3 February 27th 07 04:02 PM
How can I make Excel display HTML code as text roopytoopdongle Excel Discussion (Misc queries) 1 March 20th 05 06:40 AM
Code to edit directly in cells from userform Tom Ogilvy Excel Programming 0 September 7th 03 10:27 PM
Control code behavior with userform ? steve Excel Programming 0 July 30th 03 05:01 PM


All times are GMT +1. The time now is 01:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"