Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Hidden sheet bleeds through

Hi,
I have a workbook that is about 5.5MB and I'm using a hidden sheet
(sheet7) to populate a userform. The user selects search criteria from
combo boxes on the first userform and then may get a second userform
if the first userform returns too many records. The problem is that
when the first userform is launched (from a worksheet button) the
column on the hidden sheet that contains the employee list "bleeds"
through to the current sheet. A secondary problem is that the userform
doesn't unload. Can anyone give me an idea as to what is happening
here? The initialization code for each form is listed below. Thanks.
James

Private Sub UserForm_Initialize() 'Primary userform
Dim R As Long
CBox3.Enabled = False
CBox4.Enabled = False
Sheets(7).Range("A2:O2").ClearContents
LastRow = Sheets(2).Cells(Rows.Count, 5).End(xlUp).Row
Raw_Data
ChkBx.Value = False
ChkBx_Change
CmdBtn.Enabled = True
For R = 2 To Worksheets(7).Cells(2, 19).End(xlDown).Row
If Worksheets(7).Cells(R, 19).Value < "" Then
CBox1.AddItem Worksheets(7).Cells(R, 19).Value
End If
Next
For R = 2 To Worksheets(7).Cells(2, 17).End(xlDown).Row
If Worksheets(7).Cells(R, 17).Value < "" Then
CBox3.AddItem Worksheets(7).Cells(R, 17).Value
End If
Next
For R = 2 To Worksheets(7).Cells(2, 18).End(xlDown).Row
If Worksheets(7).Cells(R, 18).Value < "" Then
CBox4.AddItem Worksheets(7).Cells(R, 18).Value
End If
Next
ChkBx.Caption = "Print all student records for " & _
Sheets(1).Cells(8, 2).Value & "."
End Sub



Private Sub UserForm_Initialize() 'Secondary userform and command
button click code
Application.EnableEvents = True
TextBox1.Text = "You are about to print " & (LastRow - 3) & " records.
"
End Sub
Private Sub CommandButton1_Click()
On Error Resume Next
Secondary.Hide
Unload Primary
Select Case True
Case OptBtn1
AllRecordsPrint
Case OptBtn2
If Worksheets(Sheets.Count).Name < "Summary" Then
Add_Again
End If
Summary
AddCBX
Case OptBtn3
DoEvents
Unload Secondary
Primary.Show
Turn_Off
Case Else
End Select
Unload Secondary
DoEvents
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Hidden sheet bleeds through

Just a few suggestions

In the userform try using Me.Repaint

In the workbook if you have Application.ScreenUpdating set to False you may need to re enable it whilst the other processing is done

Just quick observations from me which may help :)
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Hidden sheet bleeds through

Just a thought...
Might be a memory issue!
Have you tried using one userform with 2 frame controls that you toggle
their visibility to work like separate pages? You can have the controls
on 1st userform in Frame1 (page1) and controls on 2nd userform in
Frame2 (page2). This would also eliminate any 'cross-talk' issues
between the 2 userforms.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Hidden sheet bleeds through

On Feb 2, 8:12*am, GS wrote:
Just a thought...
Might be a memory issue!
Have you tried using one userform with 2 frame controls that you toggle
their visibility to work like separate pages? You can have the controls
on 1st userform in Frame1 (page1) and controls on 2nd userform in
Frame2 (page2). This would also eliminate any 'cross-talk' issues
between the 2 userforms.

--
Garry

Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


Thank you, Gentlemen, I really appreciate your help. I got it to work
by giving XL something else to between the unload and load processes
by having it select the sheet that it was already on. I did turn off
screen updating and used DoEvents, but those didn't work until I used
the sheet select.
James
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
Message box bleeds when moved on a userform ViViC via OfficeKB.com Excel Programming 2 September 8th 08 02:14 AM
I need my Hidden Rows to stay hidden when I print the sheet. Rosaliewoo Excel Discussion (Misc queries) 2 July 20th 06 07:51 PM
Message Box bleeds when dragged Modell Excel Programming 3 May 23rd 06 09:37 PM
Saving hidden data with a worksheet (preferably without using a hidden sheet) Dick Kusleika[_3_] Excel Programming 2 January 21st 04 04:39 PM
Problem pasting a row from a hidden sheet to the first free row on another visible sheet Didier Poskin Excel Programming 2 January 10th 04 01:18 AM


All times are GMT +1. The time now is 02:38 PM.

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

About Us

"It's about Microsoft Excel"