PC Review


Reply
Thread Tools Rate Thread

cannot see text box

 
 
s_smith_iet@hotmail.com
Guest
Posts: n/a
 
      9th Sep 2008
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?
 
Reply With Quote
 
 
 
 
FSt1
Guest
Posts: n/a
 
      9th Sep 2008
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

"(E-Mail Removed)" 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?
>

 
Reply With Quote
 
s_smith_iet@hotmail.com
Guest
Posts: n/a
 
      9th Sep 2008
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.
 
Reply With Quote
 
FSt1
Guest
Posts: n/a
 
      9th Sep 2008
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

"(E-Mail Removed)" 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.
>

 
Reply With Quote
 
s_smith_iet@hotmail.com
Guest
Posts: n/a
 
      10th Sep 2008
FSt1

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

Thanks
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using TEXT and &TEXT - display numbers with commas, underline text Gary Microsoft Excel Misc 2 20th Dec 2009 12:52 AM
Find multiple text in a cell and return text and text location dlhochfam3 General Discussion 2 30th Apr 2009 09:46 PM
Change background color in one text box based on text in 2nd text Gnerks Microsoft Access Reports 4 4th Aug 2008 02:52 PM
text is not visible. Hidden text and white text not the problem suzie Microsoft Word Document Management 4 30th Jan 2008 08:15 AM
Re: extracting text from within a cell - 'text to rows@ equivalent of 'text to columns' Dan E Microsoft Excel Programming 4 30th Jul 2003 06:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:51 AM.