Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Finding the value in a cell using a userform

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Posts
    117
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi-
    Ivan was helpfull to help me with the following code:


    Private Sub UserForm_Initialize()
    TextBox3 = employ_info.ListBox1.Text
    Sheets(TextBox3.Text).Activate
    ActiveSheet.Visible = False
    TextBox2.Text = [E7000].End(xlUp)
    TextBox1.Text = [E7000].End(xlUp).Offset(0, -3)
    End Sub

    This code selects two cell's values from another sheet and lists them in textbox1 and textbox2. This works wonders, however I neglected to mention to him that I do not want the sheet to show! If I make the activesheet.visible = true, then the code shows the text in the cells along with the sheet. I need to rearange the code so that I can still achieve the same information in the textboxes, but not show the sheet! (P.S. If I change the activesheet.visible = false, the sheet doesnt show, nor does the text in the textboxes.)Can anyone help??


  2. #2
    MrExcel MVP Russell Hauf's Avatar
    Join Date
    Feb 2002
    Location
    Portland, OR Area - USA
    Posts
    1,607
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Just refer to the sheet that is not visible by name. Something like this:

    TextBox2.Text = Worksheets("MyHiddenSheet").Range("E7000").End(xlUp)
    TextBox1.Text = Worksheets("MyHiddenSheet").Range("E7000").End(xlUp).Offset(0, -3)

    Hope this helps,

    Russell

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Posts
    117
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thankyou Russell- It worked

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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