Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default cannot see text box

I have a text box in a userform equal a cell in one sheet while a
macro runs to show the percent of macro completed......
WHen the userform comes up it is white, like it is not completely
loading and I cannot see the textbox.

I have my code start when the userform is activated. Is there another
way to bring it up?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default cannot see text box

hi
wild guessing here but if a form is not updating while a macro is running,
you may need to lace a few doevents throughout your code. the DoEvents
function yeilds code excution to the operating system(temporaryly) so that
the operating system can perform tasks in it's cache like update the screen.
look up DoEvents in VB hlep
for more info.
Regards
FSt1

" wrote:

I have a text box in a userform equal a cell in one sheet while a
macro runs to show the percent of macro completed......
WHen the userform comes up it is white, like it is not completely
loading and I cannot see the textbox.

I have my code start when the userform is activated. Is there another
way to bring it up?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default cannot see text box

Hey,

what I have is a folder where I open the files one at a time then when
I get all the info out of them I delete the file and open the next.
What I am using is count files.

First I count the all the files and put that number in a a cell then
in another cell I count every time the macro loops through the code
and count the files as they delete. I then invert the number and use
that as a percent and make a text box in a userform equal that cell.
Every loop I open the userform make it equal the cell then I turn on
the screen updating then turn off the screen updating then loop
through the code again. it may be crued but everything works but it
seems like the userform wont completely load while the macro runs.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default cannot see text box

hi
i understand what you're doing. using a form as a progress meter. unique way
too. i never thought of doing it that way. i assume your update through a
linked cell.
but the problem is updating the form ie see the info there. did you try
DoEvents?
i did a form(personal msgbox) that was suppose to change color 3 time and
display a differnt message each time. screenupdate was never turned off and i
still had problems but DoEvents did the trick. your form is probably changing
much faster than mine.
another thing you may want to consider is use of the status bar as a
progress meter. i've had considerable luck with that.
see this site
http://www.cpearson.com/excel/StatusBar.htm
also here is some sample code i did using the status bar. it's do nothing
code.
in a blank worksheet, put 10000 numbers down column A. paste this code in a
standard module to see how it work. the numbers were changeing so fast the
first run, i added an if clause to only up date the status bar every 100
numbers.
Sub usestatusbar()
Dim cnt As Long 'SB
Dim rng As Range 'SB
Dim lrng As Range 'SB
Dim rcnt As Long 'SB
cnt = 0
cnt10 = 0

'find and count records in range
Set rng = Cells(65536, 1).End(xlUp) 'SB
Set lrng = Range(rng, rng.End(xlUp)) 'SB
rcnt = lrng.Rows.Count 'SB
Application.StatusBar = rcnt & " Records"
'events to measure progress
For Each cell In lrng
cell.Offset(0, 1).Value = "hi" 'dummy duty
cell.Offset(0, 1).Interior.ColorIndex = 40 'dummy duty
cnt = cnt + 1 'SB
cnt10 = cnt10 + 1
'update status bar
If cnt10 = 100 Then
cnt10 = 0
Application.StatusBar = cnt & " of " & rcnt
End If
Next cell
MsgBox "Done!"
Application.StatusBar = False
End Sub

regards
FSt1

" wrote:

Hey,

what I have is a folder where I open the files one at a time then when
I get all the info out of them I delete the file and open the next.
What I am using is count files.

First I count the all the files and put that number in a a cell then
in another cell I count every time the macro loops through the code
and count the files as they delete. I then invert the number and use
that as a percent and make a text box in a userform equal that cell.
Every loop I open the userform make it equal the cell then I turn on
the screen updating then turn off the screen updating then loop
through the code again. it may be crued but everything works but it
seems like the userform wont completely load while the macro runs.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default cannot see text box

FSt1

I went to a progress bar using do event and it works awesome!!

Thanks


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
Using TEXT and &TEXT - display numbers with commas, underline text Gary Excel Discussion (Misc queries) 3 May 5th 23 03:46 AM
Text does not display in "Text boxs" and when wrapping text in a c Esteban Excel Discussion (Misc queries) 1 March 8th 07 11:59 PM
select text in cell based on text from another cell, paste the text at the begining of a thrid cell, etc... jsd219 Excel Programming 0 October 19th 06 05:04 PM
Excel VBA: Worksheet cell .Text property: 1024 bytes text len limit loyso Excel Programming 7 May 3rd 05 02:51 PM
extracting text from within a cell - 'text to rows@ equivalent of 'text to columns' Dan E[_2_] Excel Programming 4 July 30th 03 06:43 PM


All times are GMT +1. The time now is 04:11 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"