userform question

misterg

Board Regular
Joined
May 14, 2002
Messages
66
good day,

just a very simple one...

i have a user form that has a few buttons on (each one emails data from sheet cells to a pre-addressed email recipient).

One question.
How do i get the userform to "find" the data on the one sheet in the workbook?
I need it to "look" for the open workbook called "whatever.xls" and select the sheet called "sheet1".

Any clues, its simple i know!
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Hi misterg,

The following gets data from cell A1 on sheet1 of the workbook containing the userform. Is this what you mean?

<pre>
Private Sub CommandButton1_Click()
Dim MyString As String
MyString = ThisWorkbook.Sheets(1).Range("A1").Value
MsgBox "Data in Mystring is " & MyString
End Sub

</pre>
 
Upvote 0
Richie,

Not strictly...i just need to take attention off the userform and direct the macro back to the sheet...i already have the exytraction code written for later on in the macro...its just merely directing attention back to the sheet...something like select workbook or similar!

Many thanks anyway!

Ian
 
Upvote 0
Hi Ian,

If you just want to move focus from the userform to the workbook then try:

UserForm1.Hide

Or, to completely close it down:

Unload UserForm1

HTH
 
Upvote 0

Forum statistics

Threads
1,214,561
Messages
6,120,231
Members
448,951
Latest member
jennlynn

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