+ Reply to Thread
Results 1 to 14 of 14

Make Code Work on Any Sheet in a Workbook

  1. #1
    Forum Contributor
    Join Date
    05-16-2007
    Location
    USA
    MS-Off Ver
    MS Office 2016, Excel 2016
    Posts
    214

    Make Code Work on Any Sheet in a Workbook

    How can I retype the following so I can copy it into a different sheet without having to rename the sheet name? Currently, I have to rename the Worksheet name in the code to the current sheet name. I would much prefer it worked in any sheet I move it to. I created this using a macro, so I assume that is why it defaulted to this worksheet name.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: Make Code Work on Any Sheet in a Workbook

    If you want it to work on the active sheet, change every instance of
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,009

    Re: Make Code Work on Any Sheet in a Workbook

    .
    Try replacing :

    Please Login or Register  to view this content.
    with :

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    05-16-2007
    Location
    USA
    MS-Off Ver
    MS Office 2016, Excel 2016
    Posts
    214

    Re: Make Code Work on Any Sheet in a Workbook

    Quote Originally Posted by Logit View Post
    .
    Try replacing :

    Please Login or Register  to view this content.
    with :

    Please Login or Register  to view this content.
    That was quick! I will try it shortly, thanks again!

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: Make Code Work on Any Sheet in a Workbook

    But not as quick as me

  6. #6
    Forum Contributor
    Join Date
    05-16-2007
    Location
    USA
    MS-Off Ver
    MS Office 2016, Excel 2016
    Posts
    214

    Re: Make Code Work on Any Sheet in a Workbook

    Quote Originally Posted by Fluff13 View Post
    But not as quick as me
    lol, I just realized that. You guys must live here or something. Just changed it and tested it successfully! Thank you both!

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: Make Code Work on Any Sheet in a Workbook

    Glad we could help & thanks for the feedback

  8. #8
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,009

    Re: Make Code Work on Any Sheet in a Workbook

    .
    Glad we could help.

    Fluff :
    My computer is setup to monitor your activity. When you post a reply ... my computer waits 60 seconds then sends a copy
    of what you've posted.

    Just sayin ...

  9. #9
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: Make Code Work on Any Sheet in a Workbook


  10. #10
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,162

    Re: Make Code Work on Any Sheet in a Workbook

    You guys are so funny...Needed that lol...
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  11. #11
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,516

    Re: Make Code Work on Any Sheet in a Workbook

    Re: But not as quick as me
    Maybe "But not as quick as I"

  12. #12
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: Make Code Work on Any Sheet in a Workbook

    who cares?
    Me, Myself & I all share one thing in common.

    They's all ME

  13. #13
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,516

    Re: Make Code Work on Any Sheet in a Workbook

    Re: who cares?
    Not me. I just struck me for someone from Chippenham

  14. #14
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,162

    Re: Make Code Work on Any Sheet in a Workbook

    Proper use of English language Important is not...Important the ability to code is...

+ 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. Make Code Work in Specific sheet
    By jagadeesh.rt in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-13-2019, 06:26 PM
  2. [SOLVED] Trying to make code below work on just one worksheet within a workbook
    By alanos206 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-03-2018, 08:28 AM
  3. Make the code work in all sheet
    By nmshan1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-20-2017, 03:31 AM
  4. [SOLVED] How do I make an Auto_Open command work on a second sheet in the same workbook?
    By Hoosaskin in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 10-01-2015, 09:34 AM
  5. Make the same VBA code work for all sheets of the Workbook.
    By Francisco Sousa in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-26-2015, 07:35 AM
  6. {DELETE}Make a single sheet macro work for all sheets in workbook
    By TwistedGhost in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-05-2013, 04:29 PM
  7. How to make makros work properly when sheet is protected
    By Maiab in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-12-2012, 09:33 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