+ Reply to Thread
Results 1 to 5 of 5

Excel Macro to run on a specific title of a workbook

  1. #1
    Registered User
    Join Date
    11-21-2017
    Location
    SYDNEY
    MS-Off Ver
    2016
    Posts
    35

    Excel Macro to run on a specific title of a workbook

    I have a macro that adds formulas and formatting. i need it to

    1. run on a specific already opened workbook and worksheet with a specific name. the work book and worksheet both start with "XYZ%". the format of the file is CSV.
    2. After the macro runs save it in text format in the same location.

    thanks heaps.
    Last edited by spr2017; 06-18-2018 at 02:36 AM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: VBA Macro

    Please take a few minutes to reread the forum rules about thread titles, and then amend yours accordingly.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Excel Macro to run on a specific title of a workbook

    Thank you.

    Please Login or Register  to view this content.
    Last edited by shg; 06-19-2018 at 12:30 PM.

  4. #4
    Registered User
    Join Date
    11-21-2017
    Location
    SYDNEY
    MS-Off Ver
    2016
    Posts
    35

    Re: Excel Macro to run on a specific title of a workbook

    Hello,

    thanks but looks like the macro doesn't check other open workbooks with the same name. it does the first one and then closes it but doesn't go to the next one? also, if it can't find the workbook i can just put else exit sub?
    Last edited by spr2017; 06-17-2018 at 08:00 PM.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Excel Macro to run on a specific title of a workbook

    ... looks like the macro doesn't check other open workbooks with the same name. it does the first one and then closes it but doesn't go to the next one?
    The code checks all open workbooks until it finds a workbook named like xyz%* that has a worksheet named like xyz*%.

    also, if it can't find the workbook i can just put else exit sub?
    You can, but that's what the code already does.

+ 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. [SOLVED] macro showing error ( macro not found ) while trying to execute macro every 1 minute
    By prabhuduraraj09 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-16-2018, 07:58 PM
  2. [SOLVED] Define variable in macro than calling that macro inside another macro
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-21-2015, 10:58 AM
  3. Using a macro on workbook1 to create a button in wb2 and assigning macro "wb2!macro"
    By penfold1992 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-13-2014, 11:39 AM
  4. [SOLVED] Macro to show Which macro didnt work in a nested macro
    By akhileshgs in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-10-2013, 03:21 AM
  5. Perform macro "on open" specific file- store macro in Personal Macro Workbook?
    By thompssc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-17-2012, 12:38 PM
  6. lookup macro, solver macro, realtime macro
    By xelhelp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-02-2011, 06:14 PM
  7. Cannot find macro error when running a macro from a macro in a diffrent workbook.
    By Acrobatic82 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-05-2010, 09:22 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