+ Reply to Thread
Results 1 to 5 of 5

Activate workbook of the USERFORM

  1. #1
    Registered User
    Join Date
    07-31-2017
    Location
    PHILIPPINES
    MS-Off Ver
    2010
    Posts
    32

    Activate workbook of the USERFORM

    Please help me masters,

    How do I activate the workbook of the userform?

    Scenario:

    I'm using multiple workbooks. I still need to activate or select the workbook of my userform for it to work.

    If a different workbook is activated and I used/clicked some buttons on my userform, the macros goes on error.

    Thank you in advance!

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Activate workbook of the USERFORM

    Hi

    You should not need to activate a workbook. You should only need to properly qualify objects in the code that isn’t working at the moment.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Registered User
    Join Date
    07-31-2017
    Location
    PHILIPPINES
    MS-Off Ver
    2010
    Posts
    32

    Re: Activate workbook of the USERFORM

    Hello,

    I just did, it's now working

    Here's the code I used,

    If ActiveWorkbook.Name <> UserForm4.Caption And UserForm4.Visible = True Then
    Application.Workbooks(UserForm4.Caption).Activate

    Else

    If ActiveWorkbook.Name = UserForm4.Caption Then




    **Can you help me how can I use declaration on it?

    Thanks

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Activate workbook of the USERFORM

    I don't understand, I'm afraid. What declaration? If you properly qualify the objects you refer to in the other code in the form (not what you posted) you should not have to worry about which workbook is active.

  5. #5
    Registered User
    Join Date
    07-31-2017
    Location
    PHILIPPINES
    MS-Off Ver
    2010
    Posts
    32

    Re: Activate workbook of the USERFORM

    Hello,

    can you re-code my code above?

    Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Make userform activate right next to current open userform
    By skip2mylew in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-02-2016, 09:45 AM
  2. Activate UserForm in Personal.xlsb from Any Workbook
    By nva2k4 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-09-2016, 05:39 PM
  3. [SOLVED] How to Activate Workbook in userform
    By sthiru in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-15-2013, 04:16 PM
  4. Activate Userform on Workbook Open Question
    By Dean England in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-25-2007, 02:50 PM
  5. Workbook.Activate / Window.Activate problem
    By Tim in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-03-2006, 07:40 PM
  6. Activating userform and filling it with data form row where userform is activate
    By Marthijn Beusekom via OfficeKB.com in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-06-2005, 01:06 PM
  7. Replies: 2
    Last Post: 03-21-2005, 08:06 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1