+ Reply to Thread
Results 1 to 3 of 3

Refer to Code Name of Sheet not Name of sheet within sort

  1. #1
    Forum Contributor
    Join Date
    06-06-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    181

    Refer to Code Name of Sheet not Name of sheet within sort

    HI there,

    I am trying to change the code below so that the code refers to the sheet code name and not the name of the sheet i.e. "TestData". I tried ActiveWorkbook.sheet2.Sort.SortFields.Clear and ActiveWorkbook.sheet2.name.Sort.SortFields.Clear. But to no avail. Any help would be appreciated.

    Please Login or Register  to view this content.
    Kind regards,

    James Elwell

  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: Refer to Code Name of Sheet not Name of sheet within sort

    Just use the Sheet2 on its own without any workbook reference.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    06-06-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    181

    Re: Refer to Code Name of Sheet not Name of sheet within sort

    Thanks Works great!

+ 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. Code For A Custom Sort Using A List On Another Sheet
    By rockyw in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-06-2016, 08:51 PM
  2. Make macro on copied sheet refer to the new sheet?
    By ADJetz in forum Excel General
    Replies: 2
    Last Post: 11-27-2014, 10:57 AM
  3. [SOLVED] How to refer to the (NAME) of the Sheet rather than the Name of the sheet in my macro
    By Creare in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-11-2013, 05:11 AM
  4. Replies: 7
    Last Post: 12-16-2012, 04:24 PM
  5. help with vba code that will run a macro that will sort by name and create a new sheet
    By robinwoodard in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-25-2012, 01:04 AM
  6. Replies: 2
    Last Post: 08-21-2012, 09:15 AM
  7. [SOLVED] Refer new sheet to previous sheet
    By Spot in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-09-2005, 09:05 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