Results 1 to 4 of 4

userform question

This is a discussion on userform question within the Excel Questions forums, part of the Question Forums category; good day, just a very simple one... i have a user form that has a few buttons on (each one ...

  1. #1
    Board Regular
    Join Date
    May 2002
    Posts
    66

    Default

    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!

  2. #2
    MrExcel MVP Richie(UK)'s Avatar
    Join Date
    May 2002
    Location
    UK
    Posts
    3,330

    Default

    Hi misterg,

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


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



    Richie

  3. #3
    Board Regular
    Join Date
    May 2002
    Posts
    66

    Default

    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

  4. #4
    MrExcel MVP Richie(UK)'s Avatar
    Join Date
    May 2002
    Location
    UK
    Posts
    3,330

    Default

    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
    Richie

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
  •  


DMCA.com