+ Reply to Thread
Results 1 to 9 of 9

how to make activesheet use my activated sheet

  1. #1
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    how to make activesheet use my activated sheet

    i have this routine that copies the module1 and userform1 from one spreadsheet to another.

    but on this new project, its not working as expected. code below.

    Please Login or Register  to view this content.
    as you can see, im activating PO xx1, then i want the activesheet to pick up the name and copy over the modules and userforms.

    can anyone assist?

  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: how to make activesheet use my activated sheet

    Hi,

    That code is somewhat confusing! If you wish to import to the active workbook you must use
    Please Login or Register  to view this content.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: how to make activesheet use my activated sheet

    i got rid of all the comments, see code below:

    Please Login or Register  to view this content.
    when i run the code above, i get a run time error 60061, it says to look for form.log but i cant find it.

    what can i do to make the code work right?

  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: how to make activesheet use my activated sheet

    That error would arise if you are trying to import the form into a workbook that already contains a form by that name.

  5. #5
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: how to make activesheet use my activated sheet

    yup, your right. that was the problem. thanks very much for that.

    so i have one line in my macro that is not working right, see below:
    Please Login or Register  to view this content.
    how can i close my source workbook without having to save it?

  6. #6
    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: how to make activesheet use my activated sheet

    Close takes one optional argument for that very purpose
    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: how to make activesheet use my activated sheet

    great, i like that. all on one line. perfect.

    now i still have a problem in my macro, it is failing on this one line:

    Please Login or Register  to view this content.
    why wont it open PO xx1?

    the error is: Run time error 9, subscript out of range.
    Last edited by dmcgov; 10-04-2016 at 09:49 AM. Reason: error number

  8. #8
    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: how to make activesheet use my activated sheet

    The syntax is actually
    Please Login or Register  to view this content.

  9. #9
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: how to make activesheet use my activated sheet

    thanks xlnitwit. that fixed the issue.

+ 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. If sheet activated -> update the charts on the sheet
    By lukelucky in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-16-2015, 04:59 AM
  2. Excel Macro - Filter button activate on both sheet if activated on one sheet
    By umeshbanga in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-26-2014, 02:22 PM
  3. ActiveSheet.PivotTables => How to do it for custom sheet? (replace ActiveSheet)
    By chrisignm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-03-2014, 03:22 PM
  4. [SOLVED] Worksheet Activate does not run when sheet activated using VBA
    By solnajeff in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-03-2014, 05:40 PM
  5. [SOLVED] When sheet is activated, execute macro in other sheet and return to sheet
    By timtim89 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-16-2012, 10:50 AM
  6. Need help with Macro to run on activated sheet
    By sjsfiji in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-17-2008, 07:41 PM
  7. Load VBA on Activated Sheet
    By RigasMinho in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-25-2006, 11:25 AM

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