+ Reply to Thread
Results 1 to 5 of 5

Issue with Sheet Hidden

Hybrid View

  1. #1
    Registered User
    Join Date
    01-27-2011
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2007
    Posts
    8

    Issue with Sheet Hidden

    Hi! I am new at the forum, hope everyone it is ok. My name is Marina and I have to present a tool tomorrow at work and I do not know how to work with the following:

    this tool objective is that users can submit their request trough a forms I have created and Visual Basic and when they finish they click on a button that saves the information they uploaded in two sheets that are supposed to be hidden for them (not for me, I have set a password)

    The thing is that this Sheets are hidden but when information is submitted the Sheet where the information is loaded becomes visible. I do not want this to happen, this is the code that I have written:

    Private Sub OkButton_Click()
    If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or ComboBox2.Value = "" Or TextBox6.Text = "" Then
    MsgBox "Please complete all the required fields"
    Exit Sub
    Else
    End If

    TextBox2.SetFocus

    Sheet3.Activate


    If MsgBox("Save the request?", vbYesNo, "Warning") = vbNo Then
    Call DeActivateSheet.Sheet3
    Exit Sub
    Else
    End If


    Sheet3.Visible = xlSheetVisible
    Sheets("Sheet3").Select
    Range("A1").Select



    Do While Not ActiveCell.Value = ""
    ActiveCell.Offset(1, 0).Select
    Loop

    Dim row As Integer
    row = 2
    If Sheet3.Range("A2") = "" Then
    ActIndex = "0"
    Else
    Do Until Sheet3.Range("A" & row + 5) = ""
    ActIndex = Sheet3.Range("A" & row + 5)
    row = row + 5
    Loop
    End If

    ActiveCell.Value = Val(ActIndex) + Val(1)
    ActIndex = ActiveCell.Value
    ActiveCell.Offset(1, 0).Select


    ActiveCell.Value = "Name of the request"
    ActiveCell.Offset(0, 1).Value = TextBox6.Text

    ActiveCell.Offset(1, 0).Value = "Date Issue"
    ActiveCell.Offset(1, 1).Value = TextBox1.Text

    ActiveCell.Offset(2, 0).Value = "Issue Description"
    ActiveCell.Offset(2, 1).Value = TextBox2.Text

    ActiveCell.Offset(3, 0).Value = "Impact if not fixed"
    ActiveCell.Offset(3, 1).Value = TextBox3.Text

    ActiveCell.Offset(4, 0).Value = "Submited By"
    ActiveCell.Offset(4, 1).Value = TextBox5.Text

    ActiveCell.Offset(5, 0).Value = "Gu affected"
    ActiveCell.Offset(5, 1).Value = ComboBox4

    ActiveCell.Offset(6, 0).Value = "Priority"
    ActiveCell.Offset(6, 1).Value = ComboBox2


    End
    Cells.EntireRow.AutoFit
    Cells.EntireColumn.AutoFit


    If ComboBox4 = True Then
    TextBox1.Text = ""
    TextBox1.Enabled = False
    TextBox1.Locked = True
    TextBox2.Text = ""
    TextBox2.Enabled = False
    TextBox2.Locked = True
    TextBox3.Text = ""
    TextBox3.Text = ""
    ComboBox3 = ""
    UserForm1.ComboBox2 = False
    End If

    Sheets("Inicio").Select
    HasSR = False
    Me.Hide
    Sheet3.Visible = xlSheetVeryHidden
    MsgBox "Success!!!"

    Call DeActivateSheet.Sheet3

    End Sub

    Do you have any idea why the Sheet is being displayed even if this hidden?

    Thanks!

  2. #2
    Registered User
    Join Date
    01-17-2011
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    60

    Re: Issue with Sheet Hidden

    I don't know how to resolve this but could you please put your code in the correct tags It will help other users to read. Plus it's posting etiquette.

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Issue with Sheet Hidden

    Welcome to the forum,

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Registered User
    Join Date
    01-27-2011
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Issue with Sheet Hidden

    I am sorry for my mistake here it goes again:

    this tool objective is that users can submit their request trough a forms I have created and Visual Basic and when they finish they click on a button that saves the information they uploaded in two sheets that are supposed to be hidden for them (not for me, I have set a password)

    The thing is that this Sheets are hidden but when information is submitted the Sheet where the information is loaded becomes visible. I do not want this to happen, this is the code that I have written:

    Private Sub OkButton_Click()
    If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or ComboBox2.Value = "" Or TextBox6.Text = "" Then
    MsgBox "Please complete all the required fields"
    Exit Sub
    Else
    End If
    
    TextBox2.SetFocus
    
    Sheet3.Activate
    
    
    If MsgBox("Save the request?", vbYesNo, "Warning") = vbNo Then
    Call DeActivateSheet.Sheet3
    Exit Sub
    Else
    End If
    
    
    Sheet3.Visible = xlSheetVisible
    Sheets("Sheet3").Select
    Range("A1").Select
    
    
    
    Do While Not ActiveCell.Value = ""
    ActiveCell.Offset(1, 0).Select
    Loop
    
    Dim row As Integer
    row = 2
    If Sheet3.Range("A2") = "" Then
    ActIndex = "0"
    Else
    Do Until Sheet3.Range("A" & row + 5) = ""
    ActIndex = Sheet3.Range("A" & row + 5)
    row = row + 5
    Loop
    End If
    
    ActiveCell.Value = Val(ActIndex) + Val(1)
    ActIndex = ActiveCell.Value
    ActiveCell.Offset(1, 0).Select
    
    
    ActiveCell.Value = "Name of the request"
    ActiveCell.Offset(0, 1).Value = TextBox6.Text
    
    ActiveCell.Offset(1, 0).Value = "Date Issue"
    ActiveCell.Offset(1, 1).Value = TextBox1.Text
    
    ActiveCell.Offset(2, 0).Value = "Issue Description"
    ActiveCell.Offset(2, 1).Value = TextBox2.Text
    
    ActiveCell.Offset(3, 0).Value = "Impact if not fixed"
    ActiveCell.Offset(3, 1).Value = TextBox3.Text
    
    ActiveCell.Offset(4, 0).Value = "Submited By"
    ActiveCell.Offset(4, 1).Value = TextBox5.Text
    
    ActiveCell.Offset(5, 0).Value = "Gu affected"
    ActiveCell.Offset(5, 1).Value = ComboBox4
    
    ActiveCell.Offset(6, 0).Value = "Priority"
    ActiveCell.Offset(6, 1).Value = ComboBox2
    
    
    End
    Cells.EntireRow.AutoFit
    Cells.EntireColumn.AutoFit
    
    
    If ComboBox4 = True Then
    TextBox1.Text = ""
    TextBox1.Enabled = False
    TextBox1.Locked = True
    TextBox2.Text = ""
    TextBox2.Enabled = False
    TextBox2.Locked = True
    TextBox3.Text = ""
    TextBox3.Text = ""
    ComboBox3 = ""
    UserForm1.ComboBox2 = False
    End If
    
    Sheets("Inicio").Select
    HasSR = False
    Me.Hide
    Sheet3.Visible = xlSheetVeryHidden
    MsgBox "Success!!!"
    
    Call DeActivateSheet.Sheet3
    
    End Sub
    Do you have any idea why the Sheet is being displayed even if this hidden?

    Thanks!

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Issue with Sheet Hidden

    You made it visible:

    Sheet3.Visible = xlSheetVisible
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1