+ Reply to Thread
Results 1 to 8 of 8

How Do I Move/Count specific Sheets using Wildcard Characters?

  1. #1
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    How Do I Move/Count specific Sheets using Wildcard Characters?

    How Do I Move/Count specific Sheets using Wildcard Characters?

    Dear Forum,

    I have to Count and Move only specific Sheet Names whose Sheet Names end in "*Planning"

    Can you please help me with a VBA code for the above.

    I need to MOve specific Sheets to a New WorkBook which is created Dynamically...

    Please Login or Register  to view this content.
    The above code was provided to me by Leith Ross, I have just added the Folder Option but I want to modify the code further when the FOlder Exists if we can also delete the Folder and the files in the Folder..

    Warm Regards
    e4excel
    Last edited by e4excel; 03-24-2011 at 03:58 AM.

  2. #2
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: How Do I Move/Count specific Sheets using Wildcard Characters?

    Dear Forum,

    The below mentioned code was working efficiently however I want to create a seperate folder to store the file which contains these Moved Sheets...

    In the earlier code I had to Manually mention the no of Sheets to be Moved and also make a List of the Sheets in a Range of cells so as to move these Sheets.

    However, if I could get a code which counts the No of Sheets which have "Planning" as one of the Text in their Name then it would be easier likewise it would also be useful to perform any operation such as Moving with this Logic.

    My Sheets would have "Planning" in the last like "Amit Planning" or The Pal's Planning" so anyone with any ideas on the same please suggest..

    Also, I need help in countering the error which occurs when the Folder exists..

    I am creating a FOlder and a File in it with these Sheets in the WorkBook/File but have not countered the situation when the folder exists..

    So need help with that aspect as well..

    Warm Regards
    e4excel

  3. #3
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: How Do I Move/Count specific Sheets using Wildcard Characters?

    Hi e4excel

    You can combine If with Like

    Please Login or Register  to view this content.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  4. #4
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: How Do I Move/Count specific Sheets using Wildcard Characters?

    Quote Originally Posted by pike View Post
    Hi e4excel

    You can combine If with Like

    Please Login or Register  to view this content.
    Hi Pike, thanks for the response, I kind of am aware of this LIKE "* Planning" but do not know how to write the entire code for the same..

    Just found a useful link but still need to tweak on the code and require help..
    http://www.pcreview.co.uk/forums/gro...-t2583273.html

    Please Login or Register  to view this content.
    Can someone please tweak on this code for me please ...

    When I tried to run the code, it Moved some Sheets which did not have the word "* Planning" in them..it also moved the Sheet which is the most critical one..so please need help on the VBA front..plzzzzzzzzzzz

    In my SHeet I have 3 Sheets which should remain in the workbook always and other sheets which have thier names as "* Planning" should be moved to a new WOrkBook which should be created Dynamically..

    Please find the attachment for reference..

    Warm Regards
    e4excel
    Attached Files Attached Files
    Last edited by e4excel; 03-23-2011 at 05:34 PM.

  5. #5
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: How Do I Move/Count specific Sheets using Wildcard Characters?

    Hi e4excel

    try...
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: How Do I Move/Count specific Sheets using Wildcard Characters?

    Dear Pike,

    Thanks a lot ,that does the trick exactly what I needed but just 2-3 things remaining in that as below:

    1. I wanted to set the path for Saving the NewWorkBook in the Sheet itself as shown in the Attachment

    2. Wanted to create a folder to save the file on Desktop or in the path as mentioned above.

    3. The Name of the NewWorkBOOk or FileName should be Dynamic and I will mentioning that in the SHeet itself..

    4. The Code works brilliantly but it copies the SHeet in the reverse order can that be changed..Like the 1st Sheet in the Original WorkBook next to "Family Date Picker" on the RHS - Right Hand Side becomes the last sheet in the newWorkBook and vice-versa..

    Warm Regards
    e4excel

  7. #7
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: How Do I Move/Count specific Sheets using Wildcard Characters?

    Hi e4excel
    Please Login or Register  to view this content.
    815 post you need to help here

    one title question one solution

  8. #8
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: How Do I Move/Count specific Sheets using Wildcard Characters?

    Dear Pike,

    Ok no Issues, I will start a new query as you said and will provide references to this query for the file and the existing worked solution to move forward from there..

    Thanks a lot for the wonderful help, i was racking my brains over this for over 4 days now...

    Warm Regards
    e4excel

+ 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