+ Reply to Thread
Results 1 to 2 of 2

Renaming worksheets with criteria

  1. #1
    Registered User
    Join Date
    05-31-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    1

    Renaming worksheets with criteria

    Hello,

    I have the following code

    Please Login or Register  to view this content.
    The outer for loop looks up the sheet name in the range tabs ( a column list - same for every file, a master list of sheets that each file must possess).

    If it fails to find a match here, the nested for loop looks for a match in another range "extractedtabs" (a horizontal list, distinct for each file, mainly sheets in addition to above sheets, this list is derived from a set of source files with another macro, corresponding to every file i will run this macro on).

    Now if both checks fail, then the sheet must be renamed.

    I think the checking part in my code is ok, just stuck at the renaming part.

    The tricky part for me is how to utilize both the ranges to decide the name to use.

    This how the ranges are set up :

    Please Login or Register  to view this content.
    Follwing is an example of the ranges:

    extractedtabs looks like this - file name followed by sheets it contains
    FileA GK DEF MID ATT
    FileB LW RW CAM
    FileC ST GK
    FileD CB LB CDM CM


    Range "tabs" like this
    TABS
    Italy
    Germany
    Spain
    Portugal

    Please let me know if i am unclear and more info is needed.
    Thanks for all your help!!
    Last edited by pradeep.thakur; 06-26-2012 at 11:05 AM. Reason: Clarifications - edits higlighted in bold

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Renaming worksheets with criteria

    Do you have a sample file that you can upload?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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