+ Reply to Thread
Results 1 to 4 of 4

Can't get VBA code to do task at worksheet level not workbook level

  1. #1
    Registered User
    Join Date
    10-23-2007
    Posts
    80

    Smile Can't get VBA code to do task at worksheet level not workbook level

    Hello,

    Sorry for the unusual subject title, it's hard to know how to put this in words!

    I have the below code in my macro...

    Please Login or Register  to view this content.
    Currently when I run this macro it applies it to the whole workbook, whereas I actually want it to apply to the active worksheet only. I've tried
    Please Login or Register  to view this content.
    but this doesn't work.
    Anybody know how to do this? Sorry if it's actually really easy - I'm entirely self-taught (well, excelforum-taught) so I often miss the easy things!!

    Many thanks
    Last edited by lealea1982; 07-12-2011 at 10:06 AM.

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Can't get VBA code to do task at worksheet level not workbook level

    If the names are defined at workbook level, but you only want the ones located on the sheet, then:
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    10-23-2007
    Posts
    80

    Re: Can't get VBA code to do task at worksheet level not workbook level

    Fantastic!! Works perfectly, thank you very much!

  4. #4
    Valued Forum Contributor SDruley's Avatar
    Join Date
    04-27-2009
    Location
    Conover, NC
    MS-Off Ver
    Excel 2010 64 bit
    Posts
    415

    Re: Can't get VBA code to do task at worksheet level not workbook level

    Romperstomper

    very well done!!
    Turn Data into Information
    Turn Information into Knowledge
    Turn Knowledge into Direction
    Turn Direction into Leadership
    Turn Leadership into Results
    Stephen Druley

    It's not how quickly you think
    But how deeply you think
    The quality of thinking is measured
    by remoteness to conformance
    Stephen Druley

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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