Results 1 to 23 of 23

Wildcard for Different Sheet names

Threaded View

  1. #1
    Registered User
    Join Date
    03-28-2012
    Location
    Missouri
    MS-Off Ver
    Excel 2007
    Posts
    30

    Wildcard for Different Sheet names

    I have a macro that I have to run on 6 different worksheets. Each sheet has a different name. Rather than having to edit the macro to coorespond with the specific sheet that I am running, is there a way to use a wildcard for the sheet name that will allow it to run?

    Here is the portion of the macro that has to be edited each time to the different file name. ("FW CONVERSION")


    ActiveWorkbook.Worksheets("FW CONVERSION").Sort.SortFields.Clear
        ActiveWorkbook.Worksheets("FW CONVERSION").Sort.SortFields.Add Key:=Range( _
            "B2:B30000"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
            xlSortTextAsNumbers
        With ActiveWorkbook.Worksheets("FW CONVERSION").Sort
            .SetRange Range("A1:V30000")
            .Header = xlYes
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With
    End Sub
    Last edited by Leith Ross; 01-13-2014 at 01:06 PM. Reason: Fixed Code tags

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Create an Array which has Sheet Names excluding a Few Sheet Names to be used in a MACRO
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-29-2013, 03:24 PM
  2. Replies: 2
    Last Post: 01-24-2013, 04:56 PM
  3. Create a Formula That Uses a Wildcard for Multiple Workbook Names
    By squirl1899 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-04-2012, 03:34 PM
  4. Getting a list of Sheet Names by excluding certain Sheet Names instantenously..
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-09-2012, 12:16 PM
  5. Vlookup and sheet wildcard search
    By killar65 in forum Excel General
    Replies: 1
    Last Post: 08-25-2010, 08:32 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