+ Reply to Thread
Results 1 to 14 of 14

need help on vba code which work corresponding files depends upon file name

  1. #1
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    need help on vba code which work corresponding files depends upon file name

    Dear expert

    i have set of data range in master A:H i want split value in a col combination of hypen values to closed workbooks of A,B,C,D,....Etc depends upon list of filenames in col H:H.

    like if file name is A.xlsb in H col this code run to particular row to A workbook
    Please Login or Register  to view this content.
    Find the attachment.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    Re: need help on vba code which work corresponding files depends upon file name

    any experts help on this need urgently!! This thread already in above my post i wrong posted twice i could delete first one so please consider this actual thread!!

  3. #3
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Re: need help on vba code which work corresponding files depends upon file name

    Does this perform the desired operation:
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    Re: need help on vba code which work corresponding files depends upon file name

    hi sir i getting error while run
    Attached Images Attached Images
    Last edited by breadwinner; 02-29-2016 at 06:00 AM. Reason: atta

  5. #5
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Re: need help on vba code which work corresponding files depends upon file name

    Please Login or Register  to view this content.
    the above line should be amended to point to the directory/folder that has the "A.xlsb" and "B.xlsb' files.

    So, if you have these files on your desktop, replace the above line of code with this one:
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    Re: need help on vba code which work corresponding files depends upon file name

    Dear sir

    sorry for disturbing you again i getting error 424 even though i saved A&B file in folder "F" and path is "C:\Users\Admin\Desktop\Oracle\Forum\Download\F"

    Thanks
    Attached Images Attached Images
    Last edited by breadwinner; 03-01-2016 at 12:25 AM. Reason: pic

  7. #7
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Re: need help on vba code which work corresponding files depends upon file name

    I'm not sure, but the Directory Path maybe case-sensitive. You have a small "f" in the code, but a caps "F" in the path mentioned. Try changing "f" to "F" in the code.

  8. #8
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    Re: need help on vba code which work corresponding files depends upon file name

    No sir its small "f" only eventhough i getting error same i wrong quoted as "F". but it doesnt contrain the small or big alphs
    this is path now C:\Users\Admin\Desktop\Oracle\Forum\Scrap In scrap folder i save all files

  9. #9
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Re: need help on vba code which work corresponding files depends upon file name

    I've amended some lines in the code and tried it with the files in "C:\Test" folder and it worked for me. Please try and let me know if anything.
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    Re: need help on vba code which work corresponding files depends upon file name

    Super sir Its working amazing!! I need save & close file A&B file once run macro complete!!

  11. #11
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Re: need help on vba code which work corresponding files depends upon file name

    simply add the the following 2 lines of code, just before the End Sub (last line).
    Please Login or Register  to view this content.
    Trust your original request has been satisfactorily answered. Please mark the thread as SOLVED.

  12. #12
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    Re: need help on vba code which work corresponding files depends upon file name

    Sir last question if i add more files line up after A&B like C,D,E,F..Etc. How do i addi just try myself.
    here
    Please Login or Register  to view this content.
    pls advice me sir

  13. #13
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Re: need help on vba code which work corresponding files depends upon file name

    firstly, declare new variables ... wbC as Workbook ... and so on, then add suitable conditions in the code (as you identified)
    Please Login or Register  to view this content.

  14. #14
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    Re: need help on vba code which work corresponding files depends upon file name

    Nice!! Amazing sir works perfectly!!!

+ 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. need vba code to split rows to closed wb shets depends company code met with sht name
    By julielara in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-18-2016, 12:44 PM
  2. VBA code to insert data from multiple .txt files into one output file template file
    By psmith33 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-04-2015, 02:49 PM
  3. [SOLVED] VBA code to open many files, copy text, close file, paste text in second work
    By Bikeman in forum Excel Programming / VBA / Macros
    Replies: 27
    Last Post: 02-11-2014, 12:59 PM
  4. Replies: 2
    Last Post: 02-10-2014, 11:52 AM
  5. [SOLVED] Modify code to work with xls and xlsx files
    By CJ-22 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-31-2013, 11:21 AM
  6. VBa code to open files from two different folders and work on them simultaneously
    By rumshar in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-19-2013, 09:41 AM
  7. Update Code to work between 2 files
    By dkenebre in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-12-2005, 10:34 AM

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