+ Reply to Thread
Results 1 to 3 of 3

Current WorkSheet name VBA

  1. #1
    Forum Contributor
    Join Date
    11-15-2011
    Location
    UK
    MS-Off Ver
    Excel 2013
    Posts
    163

    Current WorkSheet name VBA

    Hi All,

    I have a Command button that shows/hides rows in a WS. I want to be able to copy the WS and rename it so need the script on my Command Button to get the name of the active sheet.

    The following code gives me runtime error 9. Any suggestions why this might be?

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Current WorkSheet name VBA

    Either remove the quotes around wsName or just use ActiveSheet.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    11-15-2011
    Location
    UK
    MS-Off Ver
    Excel 2013
    Posts
    163

    Re: Current WorkSheet name VBA

    Thanks Norie,

    I posted this at same time as you replied to my original query.

    I just noticed also that if a copy and paste into a new sheet my Cmd button disappear!? Not to worry I think I have found the answer in another thread.
    Last edited by rtcwlomax; 06-16-2015 at 07:03 AM.

+ 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. Copy current month named worksheet and paste into a static worksheet
    By Jissenka in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-26-2015, 11:28 PM
  2. [SOLVED] Set PivotTable Filter to Current Day, Current Week, Current Month, or Current Year
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-30-2014, 08:31 AM
  3. Turning a function from serving current worksheet to specific worksheet
    By ahmadmasri in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-15-2013, 10:15 PM
  4. Replies: 1
    Last Post: 04-07-2006, 07:54 AM
  5. Replies: 0
    Last Post: 09-22-2005, 12:05 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