+ Reply to Thread
Results 1 to 7 of 7

Excel VBA modification help

  1. #1
    Registered User
    Join Date
    01-30-2015
    Location
    Europe
    MS-Off Ver
    2010
    Posts
    31

    Excel VBA modification help

    Hello,

    i am a new user of excelforum. i heard good stuff about this forum today is my first day joining as new user.

    i had a question which i posted in Mrexcel and there i got no reply.

    so this is re-post.

    http://www.mrexcel.com/forum/excel-q...lications.html

    basically the attached file from chandoo website is a good macro, it lacks one feature the source file sheet names. like sheet below. i need help on modification of vba so that the source file sheet could also be considered.

    thanks very muchCapture.PNG
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Excel VBA modification help

    You're attached file is shown as corrupted when i try to Open it, so I can't see the code.

    But if it helps, the sheet name is stored as .Name in the Worksheet object. So an over simplified example would be:

    Please Login or Register  to view this content.

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Excel VBA modification help

    Hello excelismagic,

    Replace your macro with this one.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Registered User
    Join Date
    01-30-2015
    Location
    Europe
    MS-Off Ver
    2010
    Posts
    31

    Re: Excel VBA modification help

    Thank you dear leith.

    it is almost close.

    since i was not able to attach again the workbook here. i have uploaded them in this shared folder link https://www.dropbox.com/sh/y2kncmtxh...-SrUeq_xa?dl=0

    the first error runing the code, i got was with not having the backlsash application path. so when i manually added backlsash before workbook names like this \Book1.xlsx that error seems to goaway and the next error stops at line Set SrcWks = SrcWkb.Worksheets(Cell.Offset(0, 2)) stating a mismatch error.

    thanks for your help.

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Excel VBA modification help

    Hello excelismagic,

    Thanks for workbooks. I corrected the problems with the macro. The workbook below has the updated macro and been assigned to the button on the worksheet.

    Revised Macro Code
    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    01-30-2015
    Location
    Europe
    MS-Off Ver
    2010
    Posts
    31

    Re: Excel VBA modification help

    Leith,

    Thank you very much. you are genius!

    I am really amazed with the level of knowledge you have. finding this excel forum is the best thing happened to me.

    thanks a lot and wish you a wonderful Sunday

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Excel VBA modification help

    Hello excelismagic,

    You're welcome. Glad I could help.

+ 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. Modification in the Excel to Outlook mail
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-19-2014, 10:27 AM
  2. .txt to excel, modification in contents & then back to .txt without changing format.
    By Jagdish Sharma in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-02-2013, 01:56 AM
  3. [SOLVED] Excel Template modification using automation
    By Terry Holland in forum Excel General
    Replies: 1
    Last Post: 03-30-2005, 02:06 PM
  4. [SOLVED] Excel file modification date
    By GROSNER in forum Excel General
    Replies: 5
    Last Post: 03-03-2005, 10:06 PM

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