Results 1 to 7 of 7

Thread: [RESOLVED] Application ScreenUpdating=false not working on userfrom_activate

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2016
    Posts
    9

    Resolved [RESOLVED] Application ScreenUpdating=false not working on userfrom_activate

    Gurus

    My problem:When the "Transer" userform is activated the user can view actions being performed on the sheet "Stored" (xlVeryHidden) which I do not want visible.

    I have a userform "Transfer" that is called from userform "PartsListTrans":

    Private Sub PartListTrans_Click()
    Unload TransSupp
    Transfer.Show
    End Sub

    This is the code for Transfer userform

    Private Sub UserForm_Activate()
    Application.ScreenUpdating = False
    ActiveWorkbook.Worksheets("Inventory").AutoFilterMode = False


    Sheets("Stored").Visible = True
    'clears columns A
    Sheets("Stored").Select
    Columns("A").Select
    Selection.Delete
    'This puts the value from a cells on inventory into into TextBox1 _
    when the userform is activated
    Dim ws As Worksheet
    Set ws = Worksheets("Stored")
    TextBox1.Value = ws.Range("b1").Value
    TextBox2.Value = ws.Range("b2").Value
    TextBox3.Value = ws.Range("b3").Value


    End Sub

    Thanks ahead of time for any assistance.

  2. #2
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    3,574

    Re: Application ScreenUpdating=false not working on userfrom_activate

    Could you make the sheet invisible when the workbook opens?

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2016
    Posts
    9

    Re: Application ScreenUpdating=false not working on userfrom_activate

    That's correct the sheet is VeryHidden when Workbook opens. I only need it open for this single userform. It needs to remain VeryHidden after the routine is complete.

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Application ScreenUpdating=false not working on userfrom_activate

    you could try to set screenupdateing to false before userform.show
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2016
    Posts
    9

    Re: Application ScreenUpdating=false not working on userfrom_activate

    No that didn't work either westconn1. I moved screenupdating around to various lines in "Private Sub PartListTrans_Click() "Private Sub UserForm_Activate()" I also moved some of the lines of userform_Activate() to PartsListTrans_Click() with screenupdating=false but results are the same , work on sheets "Stored" is always visible.

  6. #6
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    3,574

    Re: Application ScreenUpdating=false not working on userfrom_activate

    You don't need to unhide it when the form activates. Here's an example:

    Code:
    Private Sub UserForm_Activate()
        Dim ws As Worksheet
        Set ws = Worksheets("Sheet1")   'my hidden sheet
        With ws
            .Range("c1:d1").Delete
            Me.TextBox1.Text = .Range("b2").Value
            Me.TextBox2.Text = .Range("b3").Value
        End With
    End Sub

  7. #7

    Thread Starter
    New Member
    Join Date
    Aug 2016
    Posts
    9

    Re: [RESOLVED] Application ScreenUpdating=false not working on userfrom_activate

    Vbfbryce , that was the solution, no need to unhide the sheet. Thank you everyone for the help!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width