+ Reply to Thread
Results 1 to 12 of 12

Run Same VBA Macro Code On Multiple Sheets of Multiple workbooks

  1. #1
    Registered User
    Join Date
    06-11-2013
    Location
    Tampa
    MS-Off Ver
    Excel 2010
    Posts
    19

    Run Same VBA Macro Code On Multiple Sheets of Multiple workbooks

    Hi,
    I have multiple excel files, each of them has multiple worksheets. I want to write a code that goes through all the worksheets of all the files, and converts numbers stored as text to numbers.
    Here is what I've coded, but it gives me an error: "run time error 438-- object doesnt support this property or method"

    Please Login or Register  to view this content.
    Any suggestion is appreciated.
    Attached Files Attached Files
    Last edited by AnnaDana; 06-28-2013 at 09:22 AM.

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Run Same VBA Macro Code On Multiple Sheets of Multiple workbooks

    Untested,

    Please Login or Register  to view this content.
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  3. #3
    Registered User
    Join Date
    06-11-2013
    Location
    Tampa
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Run Same VBA Macro Code On Multiple Sheets of Multiple workbooks

    Thanks JapanDave, but it gives compiling error on the Do statement and highlights .sheet.

  4. #4
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Run Same VBA Macro Code On Multiple Sheets of Multiple workbooks

    Can you post a sample wrkbook?

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Run Same VBA Macro Code On Multiple Sheets of Multiple workbooks

    May be

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    06-11-2013
    Location
    Tampa
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Run Same VBA Macro Code On Multiple Sheets of Multiple workbooks

    Thanks AB33. It works perfectly. It's just that I prefer it ask for the file location. Could you please let me know how I can modify it?

  7. #7
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Run Same VBA Macro Code On Multiple Sheets of Multiple workbooks

    Then use this,

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    06-11-2013
    Location
    Tampa
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Run Same VBA Macro Code On Multiple Sheets of Multiple workbooks

    Could you please post the complete code? I got type mismatch error when I modify it as:

    Please Login or Register  to view this content.

  9. #9
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Run Same VBA Macro Code On Multiple Sheets of Multiple workbooks

    Untested,

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    06-11-2013
    Location
    Tampa
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Run Same VBA Macro Code On Multiple Sheets of Multiple workbooks

    No JapanDave, it gives "object required" error and it's because of with v statement.

  11. #11
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Run Same VBA Macro Code On Multiple Sheets of Multiple workbooks

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    06-11-2013
    Location
    Tampa
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Run Same VBA Macro Code On Multiple Sheets of Multiple workbooks

    Thank you AB33! It works

+ 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