![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Posts: 117
|
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 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Portland, OR USA
Posts: 1,374
|
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 |
|
Board Regular
Join Date: Feb 2002
Posts: 117
|
Thankyou Russell- It worked
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|