Finding the value in a cell using a userform

Todd_M

Board Regular
Joined
Feb 24, 2002
Messages
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??
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
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
 
Upvote 0

Forum statistics

Threads
1,214,387
Messages
6,119,208
Members
448,874
Latest member
Lancelots

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top