+ Reply to Thread
Results 1 to 67 of 67

List out the file names present in the folder using excel macro

  1. #1
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    List out the file names present in the folder using excel macro

    Hi All,

    Im having n number of files in the folder and all the files are same but having diffrent data and diffrent name.I want to pull the data's from N number of files to master excel file.I m able to pull the data from all the files.Here i want to list out the file names when i select the data from multiple files.

    Im having the seperate code for pull the data and list out the file names.But i want to merge the code to perform action at a single shot.Consolidated data base work book having more sheets..

    Any one can take a look and help me out.

    below is the code for listing file names present in the folder:

    Please Login or Register  to view this content.
    And below is the code for pull the data from more excel files

    Please Login or Register  to view this content.


    Thanks ,
    Lakshmanan
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Can anyone take a look and reslove this query..?

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: List out the file names present in the folder using excel macro

    Hi laxmanann

    Untested but you can try adding the indicated Line of Code
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Hi Jaslake,

    That code is working fine for me.First off all thanks for the correction and the reply.With the help of above code am able to get the file name for the selected file.

    My Actual requirement here is:

    Usually we are collecting data's from various projects and placed in one share point folder.By using my macro i need to collect all the relavant datas from he month files of all projects.
    Every month we are colletiong the datas and placing in diffrent folder with folder name like Jan,feb..etc..Dec.

    Here i have attached four xcel sheets.
    data base sheet is a conslidated sheet
    Mont,Month2,Month3 ecel sheets are projects sheets.

    Fo every quarter and and ever half and annualy we are calculating datas with the help of monthly data's.


    With my attached macro am able to consolidate or import datas for the first month data alone.But i need to collect the data all the month data's or if i select 3or 4 month datas means that all should import from the folder to data base sheet.
    Please refer my attached macro data base sheet and project sheets.


    Please help me to import datas for all the months in a year .....expecting your possitive reply

    Thanks,
    Lakshmanan
    Attached Files Attached Files

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: List out the file names present in the folder using excel macro

    Hi Lakshmanan

    You indicate this
    That code is working fine for me
    But That Code does not appear to be in your Workbook...update the Workbook Code with Code that works.

  6. #6
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: List out the file names present in the folder using excel macro

    Hi Lakshmanan

    Try this attached file and let me know

    Note: Put all the Month files in one folder & then run the Macro , When Dialog box will open that time SELECT all the files from Down to Up whatever files u want to merged then click on Open ok

    do let me know if any further assistance required & i hope this will work fine for u...
    Attached Files Attached Files
    Thanks - Naveed
    -----------------------------
    If the suggestion helps you, then Click * to Add Reputation
    To Attach File: Go Advanced>>Manage Attachments>>Add Files (In Top Right Corner)>>SelectFiles>>.........Locate Your File(s)>>Upload Files>>Done (In Bottom Right)
    1. Use [code] code tags [\code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    2. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

  7. #7
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Hi Jaslake,

    Thanks for the info.actually i put that code in my workbook.That s like sample work book.Now here am attaching my original workbooks that im going to execute for my porject.Please use the below sheets and excute once ..and then help me out for the post number 4 of this thread..


    Thanks ,
    Lakshmanan
    Attached Files Attached Files
    Last edited by laxmanann; 03-29-2014 at 02:34 PM.

  8. #8
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Hi Naveed,

    Thanks for the reply.I have attached my whole macro work books here the thread number 7.Please runt the database code and pull the datats from months sheet.That all working fine for me.as per Jaslake advice i have done the sheet name pulling process.Now here the last challange is i need to collect the data's for diffrent month of the year.Like if i want jan month data alone i will jan month project datas in one folder and pul easily.If i want to take 3 or 4 months data means the macro should selct that 4 months data alone.How i achive this by the month refernce.With my attached macro im able to select only one month data alone..


    Naveed and Jaslake you ppl are the hope..Pls help e out to complte this activity..Am in the neck point now...


    Thanks ppl

    Quote Originally Posted by Naveed Raza View Post
    Hi Lakshmanan

    Try this attached file and let me know

    Note: Put all the Month files in one folder & then run the Macro , When Dialog box will open that time SELECT all the files from Down to Up whatever files u want to merged then click on Open ok

    do let me know if any further assistance required & i hope this will work fine for u...

  9. #9
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: List out the file names present in the folder using excel macro

    Hi Lakshmanan

    What do you expect your Data Base File to look like after you've imported Data from Month 1, 2 and 3? Just show me (us) the Project Column on each Worksheet in Data Base File after the import of these three months.

  10. #10
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Hi Jaslake,

    Thank you fo the reply.Here i have attached the data base file.This was ran by one time.for Name shaking only i have Named the files Like Month1,Month2,Month 3.In all the sheets the Project name is indicated as "Project".With my attached macro am able to retrive all the data
    and sheet name easily.Here all the sheets like month 1,2 3 all are the same month But diffrent projects (Let us cnsider like Jan month data of the projects).For name name shaking only i have given like mnth1,2,3.But all the sheets of the data base work book we can able to the all the
    months from Jan to dec.With my macro am able to get the data for Jan month or only one data can be retirved.Nut our quarter or half or annualy reports we are considering 3 or or 12 months of data.at this point my macro usgae is not worthful.So only am asking help here..



    Thanks,
    Lakshmanan
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    if i run the Macro it will collect the datas and paste the datas into January month of the each worksheets of the data base file.But if i select More than one month it shoulb place the datas into the respective month of the worksheets..For your information ..the month are named top of all the sheets in the data base sheet..


    Thanks,
    Lakshmanan

  12. #12
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: List out the file names present in the folder using excel macro

    Hi Lakshmanan

    How is it then, in the Sample Data File attached to your Post #10, that Months 1, 2 and 3 are listed under Jan 13? I'm trying to understand your logic and I'm failing...

    I need to see your expected results for the three months...

  13. #13
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    HI Jaslake,

    Here now we have to consider the Month1,Month2,Monh3 Sheet as a Project1,Project2,Project3...In all the sheets under the Project column the Project1(Month1),Project2(Month2) like wise sitting when run the macro.Totally we have 30 Stable projects in my account.
    So for all the 12 months we are receving the diffrents datas from same 30 projects only.So only am placing the 3rd column as a project column.any way for 12 months we are going to collect the diffrent datas from same project.So am placing projects as a common column.
    If i want to to get the datas from jan month am going to jan month folder and receving data sing this macro.next if i want feb,Mar datas along with jan months means it should collect the datas for all the selected month.Thats is the chalange here.
    This is my indian time crossed mid night.But i din get sleep.Eagarly waiting for your reply and help.


    Thanks,
    Lakshmanan

  14. #14
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: List out the file names present in the folder using excel macro

    Hi Lakshmanan

    Get some rest...I'm about to pack it in for the day.

  15. #15
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    No Issues jaslake,

    Helping others is a great thing.Am just giving idea and getting sleep is not a gud thing and it is not meaningless.You are helping me.Am not die if i not sleep today.Want to give respect ppl.

    This is the one to decide my next level of my carrier.I promised to my manager like " I will submit this project report in coming two days"


    Thanks,
    Lakhmanan

  16. #16
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: List out the file names present in the folder using excel macro

    Hi Lakshmanan

    I'd not count on this
    " I will submit this project report in coming two days"
    If your expected output when you select 3 months is as displayed in Post #10, that Months 1, 2 and 3 are listed under Jan 13 then we can give you that. I'm fairly certain that's not what you want.

    Demonstrate what it is you want...I suspect your Data File worksheets need rework.

  17. #17
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Hi Jaslake,


    I have attached My database file with the Projects files.Let us consider this projects files are jan month files .When running macro it collects data perfectly..In the project column of all the sheets having project names after running the macro.This is report for jan Month.if i have all the the 12 months data in 12 different folder means what i have to do.This is the problem here.While data uploading to the master sheet they asked me to put the progress bar to show the progress..

    Hoping you are clear...If anything needed pls message me..am waiting
    Attached Files Attached Files

  18. #18
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Hi Jaslake,

    As per your dvice i have attached my files and output data base sheet..Please ask me if you need anything..i will share you the details.


    Thanks,
    Lakshmanan

  19. #19
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: List out the file names present in the folder using excel macro

    Hi Lakshmanan

    I can't make any sense out of it...perhaps another can. Bump your Thread.

  20. #20
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Hi Anyone,

    Hi,

    Almost,I have done with the macro.Please use that data base sheet and pull the datas from Projects sheets..Here im able to pull the datas for a single month only..That three project reports are for jan month data..Im able to pull with the help of my macro.But i need to pull the datas for Whole year like 12 months or some times i need to pull the datas for month selection basis.
    That 3 projects depends on jan month..Like wise all the months am having datas in the same format but diffrents datas.This 3 projects has been placed in one folder.If want to pull the data for Jan month means i browse Jan month folder and pull the data using my macro..Am facing problem when i need to select more than one month or a 12 months of data.And i dont know the logic how to pull the data..


    Thanks
    Lakshmanan

  21. #21
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: List out the file names present in the folder using excel macro

    Hi Lakshmanan

    I received your PM...still don't see an attachment that populates more than one month. Do it manually so we can see your output requirements. Attach the Files that you used to create the manual population.

  22. #22
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Hi All,

    "Bump no response"


    Thanks,
    Lakshmanan

  23. #23
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: List out the file names present in the folder using excel macro


    Hi alone !

    "Bump no attached files ‼‼‼"

  24. #24
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Hi Marc L,

    I have attached my all files in the Thread reply number 17.Please have a look and help me out.


    Thanks,
    Lakshmanan

  25. #25
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Hi Jaslake,

    Please see all the sheets top first row there we have mentioned all months.Now i have attached three projects with datas..that all related to Jan month data..all the month having same templete of the projects.But inside of the project template data only will be changing for every month..like feb,Mar,april...

    Steps to be followed:

    1.Place all the three prjects workbooks in one folder (Folder name like January).Use the macro present in the Data base work book and pull the data from three projects.It should pull and place the datas in the appropraite cells which mapped in the macro sheet.

    2.Copy all the Projects (3 projects) workbooks and place another one folder and name the folder like Feb.Now pull the values using data base macro workbook.Here the datas should go to Under the feb month (Month mentioned in the first row of all the sheets in the data base work book) of all sheets

    3.Like wise Mar,april,may...etc.


    This is the full requirement.
    If you have any query pls ask me..


    Problem faced:

    whenever am pulling data from folders..it will be going to place under the Jan month of every sheet.This is my problem..


    Please help me..


    Thanks,
    Lashmanan



    Quote Originally Posted by jaslake View Post
    Hi Lakshmanan

    I received your PM...still don't see an attachment that populates more than one month. Do it manually so we can see your output requirements. Attach the Files that you used to create the manual population.

  26. #26
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Hi anyone,

    Please take look on my query.I have done 90% of my macro work and waiting 10% completion alone.Please help me..Any help appreciated.


    Thanks,
    Lakshmanan

  27. #27
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: List out the file names present in the folder using excel macro


    See post #21 …

  28. #28
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Hi Marc L,

    I have uploaded the all the attachements in the post #17 and gave the detailed comments in the Post # 25..Please let me know if you people need more information..

    Thanks,
    Lakshmanan

  29. #29
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Thumbs down Re: List out the file names present in the folder using excel macro


    Why not to have directly explained it in the post #22 instead of a very bad "Bump no response" ?!

    Should I remember you this forum is supported by contributors who dedicate part of their time
    in an absolutely free way to help other people and answer questions ?

    In case of a high priority issue and you can't even wait a bit,
    you always have the alternative to afford commercial services or hire a local consultant …

  30. #30
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Hi Marc L,

    Im not forcing you people.Just asking help..I have done with 90% work.Balance 10% only am waiting....sorry for the inconvienece..Please help me..

    Thanks a lot

  31. #31
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: List out the file names present in the folder using excel macro


    Some people asked me for an old code of mine why its process time had so much increased after a mod.
    My answer was if my own code was quicker before the mod, the issue came for sure from the mod !
    After a while, they insisted again, the code was working properly but didn't find out any reason.
    I told them to restore back my original procedure but they hadn't save it !

    Weeks later, when I could jump to their office, the process time was 48 seconds at each call of procedure.
    The mod was just an UserForm progress bar upgrade and
    I saw the data increased so much from original demand …

    Just by deleting the progress bar, the process needed no more than 18 seconds, a 30 seconds gap ‼
    After rethinkink of the real needs, I optimized the procedure : less than 3 seconds at first call,
    next calls are instant !

    And as a progress bar is a very easy basic logic of a percentage of work done versus work to be done
    and 'cause it's a common explained subject on the net, I won't waste my time …

    It's your time to work or wait for jaslake's answer !

    Regards !
    Last edited by Marc L; 04-02-2014 at 05:03 AM.

  32. #32
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Hi Marc L,

    Im not asking about Progress Bar now.Just pull the data and place the datas into next empty cell of the upcoming months in the Data base sheet.It would be fine even if you provide me the logic or one liner code.I will make as whole.Please help me on the same..


    Thanks,
    lakshmanan

  33. #33
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: List out the file names present in the folder using excel macro


    Sorry, I confused with another of your threads !

    But just notice if a guru as jaslake « can't make any sense out of it » and
    asked you for a data mod - and seems still waiting ! - I would not do better !

    Maybe he is away fishing around the lake !

    Closed subject from my side, much ado about nothing

  34. #34
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    HI Jaslake,

    As per your advice i have updated all the requirements details and the in the thread post # 25.Please help me..You are the only hope for me..And am waiting for your reply for past 2 days.Please ask me if im not clear.Apologize for all the confusions..Please have a look on the #25th reply...


    Thanks,
    Lakshmanan

  35. #35
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: List out the file names present in the folder using excel macro

    See Post #21...if you can't provide this we can't provide a solution...

  36. #36
    Forum Contributor lancer102rus's Avatar
    Join Date
    04-02-2014
    Location
    Ufa
    MS-Off Ver
    Excel 2010, 2013
    Posts
    252

    Re: List out the file names present in the folder using excel macro

    Here is your solution, laxmanann.
    Data Base1.xlsm

  37. #37
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Hi lancer102runs,

    Thanks for the Help.Codes are great..But..


    My requirement is :

    I have a some 30,30 files in everymonth folder(Like 12 months seperate folder).Here the project 1,2...Projects 30 are the diffrent project files.All the 12 months i have a same 30,30 projects only.So there is no change in the project files.Like we assume one project Name as project1.All the 12 months folders having this project work book as project1.But jan month we have a different data for project1 and Feb month we have diffrent data for project1 one and march month we have diffrent data for project1.Like wise all the 30 projects works having different datas for diffrent month.For that we have mentioned JAn to Dec month (at the top) in the data base workbook.IF i want to pull the data for Jan month i will use this macro and pull the datafor all the 30 porjects.After that i need to pull the datas for Feb Month from Feb folder for Project1 to Project30.So the macro should pull the datas for Feb month from the 30 projects from the Feb folder contains 30 projects(from Project1 -Project30).


    But in the attached macro Pulling data for feb month and placing the datas 4th row of the Feb month.So all the Sheets in the data basse work book the Column Project Contains the 30 Projects Name only.But i want to place the Data in the respective row of the Respective month.

    Asssume,I pulled the data For JAn month Actually.And next am going to pull Feb month data.So here the Macro First read the Jan Month Columns and Place the Datas into Under the Feb month if the Jan month Cells are filled with datas.Like Till december the Macro should work for the sheets present in the Data base work book.


    Please help me.

    Thanks,
    Lakshmanan
    Last edited by laxmanann; 04-03-2014 at 04:12 AM.

  38. #38
    Forum Contributor lancer102rus's Avatar
    Join Date
    04-02-2014
    Location
    Ufa
    MS-Off Ver
    Excel 2010, 2013
    Posts
    252

    Re: List out the file names present in the folder using excel macro

    Hi!
    Here is v.2. If you mark "replace" all data will be filled from the begining, otherwise they added consequentially.
    Data Base1 v2.xlsm

  39. #39
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Hi lancer102runs,

    Thanks first off all

    That macro is working fine as expected except one thing. let us assume here the selected 4 projects workbooks placed in one folder (Folder name is like January).These datas for one month data and which is filling correctly using this macro.Assume if i have same 4 projects But having diffrent datas for month feb and these 4 projects workbooks placed in another one folder(Folder Name is Febrary).So once the Jan month data load is completed im goin to select feb month data from the feb month folder which having like these same projects but diffrent datas for Feb month.Like wise March.april,may,june...till dec..

    Detils:
    If i select Feb data from feb folders that datas should go to the cells L3 to R3 in the "Defect" Sheet for project1
    If i select Feb data from feb folders that datas should go to the cells L4 to R4 in the "Defect" Sheet for project2
    If i select Feb data from feb folders that datas should go to the cells L5 to R5 in the "Defect" Sheet for project3
    Like wise for All 30 projects..for all the 6 sheets the macro should work..



    If i select March data from March folders that datas should go to the cells T3 to Z3 in the "Defect" Sheet for project1
    If i select march data from March folders that datas should go to the cells T4 to Z4 in the "Defect" Sheet for project2
    If i select march data from March folders that datas should go to the cells T5 to Z5 in the "Defect" Sheet for project3
    Like wise for All 30 projects..for all the 6 sheets the macro should work..

    Problem faced here: But here the data select 2nd time it is keep on filling down on the JAn month (Months mentioned in the top of the all sheets)


    Please check and help me on the same..Eagarly waiting for your next version


    Thanks,
    Lakshmanan

  40. #40
    Forum Contributor lancer102rus's Avatar
    Join Date
    04-02-2014
    Location
    Ufa
    MS-Off Ver
    Excel 2010, 2013
    Posts
    252

    Re: List out the file names present in the folder using excel macro

    OK. I anderstand you. Try to do my best

  41. #41
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Thanks in advance lancer102rus..

  42. #42
    Forum Contributor lancer102rus's Avatar
    Join Date
    04-02-2014
    Location
    Ufa
    MS-Off Ver
    Excel 2010, 2013
    Posts
    252

    Re: List out the file names present in the folder using excel macro

    I hope this is the last version of the programm
    Data Base1 v3.xlsm

  43. #43
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Hi lancer102rus,

    Your code is working fine.But still having one problem when pulling the data.

    Steps to reproduce:

    PLease follow the below the steps and check your end once.

    1.Download and place the projects files like project1,2,3 and name the folder like Jan month data..
    2.Download the same projects files and place it another folder And name the folder Feb month data.
    3.Run the macro and the datas from Jan month folder (All the datas will go and Place under Jan month of all cells in the data base sheet.There is no pbm in it)
    4.Dont close and run again and pull the 3 projects details from Feb month folder. (Here only im facing proble.All the feb month datas are sitting under the Same Jan month cells of the data base sheet.But that not i want. When im pulling datas second time or Some other folder the macro should Read all the Previous months rows of cells and place the datas into next available row of the next month In the same rows..till december..This is what i want )


    Like wise Mar,Apr,May..Till dec....


    Simply,The Next month row cells needs to update When am pulling second time even if select Same month datas from same folder second time or after


    Let me know for any questions


    Thanks,
    Lakshmanan

  44. #44
    Forum Contributor lancer102rus's Avatar
    Join Date
    04-02-2014
    Location
    Ufa
    MS-Off Ver
    Excel 2010, 2013
    Posts
    252

    Re: List out the file names present in the folder using excel macro

    Hi, laxmanann!
    Tell me, please, whata date must be in the "B37" cell in February file? I thought there must be only February. But after step #2 we will have files with January dates (even though they are in February folder). Am i right, or wrong?

  45. #45
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Hi lancer102rus,

    Here Not only 2013 ..Like every year we are consolidating the datas.If We are going to take Datas from January folder for 2013 means only in all the area of the Projects sheets having Jan-2013 only.If we are taking Feb means the B37 having Feb month dates.Thats not my problems.Like wise for aMar,april..till dec..Here Each and every month all project team Sending datas to me with correct month and dates.So thats specific projects team work.

    Here what im doing means..Just am recevig data works from all the projects and placing one folder and naming that specific month and consolidating datas.


    Here the macro should pass the values present in the projects sheets to Data base sheet for every month.

    B37 Value for Jan month- Jan date
    B37 Value for Feb month- feb date
    .
    .
    B37 Value for Dec month- Dec date


    Here the macro first should read the first month value.If the rows of the Particular month is empty the macro should palce the copied values.If Not null then the macro should read the next month rows cells and check.If not null place the copied value.if null then put the copeied value in that month itself.


    Like
    Macro run->Pull datas for one month from one folder->First the macro should check the Jan month Rows cells->If null of Rows under Jan month the place the data->If not null then the macro should Check the same condition in the Feb month-->If null ..Place the Values in the Feb cells itself->If not null then check the MArch Month..


    Hope i have explained clearly..

    Let me know for any queries..

    Thanks Again
    Lakshmanan
    Attached Images Attached Images
    Last edited by laxmanann; 04-04-2014 at 04:58 AM.

  46. #46
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Let us assume defect sheet for example:

    First Pull for one project:

    First pull the datas from one folder and check the D3 to J3.If D3 to J3 cells are null then the macro should place the copied values to D3 to J3.

    Second pull for same project (Even if it is same file):

    Macro should Check the D3 to J3 Cells.So alredy it is filled with datas.So it should go to the next Feb month rows and check whether the data are present in the L3 to R3.If Null velues present in the cells then place the values here L3:R3.

    3rd pull for same project (Even if it is same file):


    Macro should Check the T3 to Z3 Cells.So alredy it is filled with datas.So it should go to the next March month rows and check whether the data are present in the T3 to Z3.If Null velues present in the cells then place the values here T3:Z3.

    Like wise for all the months and all the projects and all the workbooks the macro should pull and place the values..


    Thanks,
    Lakshmanan

  47. #47
    Forum Contributor lancer102rus's Avatar
    Join Date
    04-02-2014
    Location
    Ufa
    MS-Off Ver
    Excel 2010, 2013
    Posts
    252

    Re: List out the file names present in the folder using excel macro

    My code works so:
    1) open file from folder
    2) read the date in "B37" cell
    3) searching the filename in column "Project".
    3a) if such name already exists, then we remember this row
    3b) if we found nothing, then programm adds row after the last filename and
    4) for each sheet in "Data Base" file programm calculates column according to the date from 2)
    5) after we found row and column, programm copies data beginning from that cell
    6) going to the next file.

    Did you tested programm on real datas?

  48. #48
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Dear lancer102rus,

    Thanks for the helping.I have tested with real datas and it is working fine for me.Is this possible to set the progress bar based on the data load.?



    Thanks,
    Lakshmanan

  49. #49
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Hi lancer102rus,

    I have used the code with small update for Design productivity Sheet in the data base sheet.But am gettig error.can you please check and help me out.

    Please Login or Register  to view this content.

  50. #50
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    If anyone there in online..Please have a look and help me out.

    Thanks,
    Lakshmanan

  51. #51
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,036

    Re: List out the file names present in the folder using excel macro

    Upload example workbook with some input and desired output and state your problem.
    Never use Merged Cells in Excel

  52. #52
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Hi Zbro,

    Thanks for the reply..Post #42 Having one attachement and the datas some of the cells there and that is my output.In the attached macro file has a code for all the sheets present in the macro data base file...(Defect,Effort,Scedule,Review defects,Design productivity,Execution productivity are the sheets present in the data base file.)In the Post#42 Having macro for all the above sheets except "Design productivity".But i have tried to put the same code (logic) for the Design prodcutivity sheet.But Nothing that alone not working out and other sheets related coding working as expected.just need to debug.i tried a lot .But not working.

    I just added the below code alone with the existing code.but not working.Pls help me this alone

    Please Login or Register  to view this content.

  53. #53
    Forum Contributor lancer102rus's Avatar
    Join Date
    04-02-2014
    Location
    Ufa
    MS-Off Ver
    Excel 2010, 2013
    Posts
    252

    Re: List out the file names present in the folder using excel macro

    Thats all what i can do
    Data Base1 v4.xlsm333

  54. #54
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Thanks lancer102rus,

    feel so happy of your Macro code....But i need small extra features..

    "Effort" Sheet:

    Under the mentioned column of the data base sheet:

    Planned Effort-F6 Value of "Raw Data Sheet"
    Total Actual Effort-J6 Value of "Raw Data Sheet"
    Total Core effort-J6 Value of "Raw Data Sheet"
    Rework Effort-K6 Value of "Raw Data Sheet"

    Effort on Prevention Cost-->C12 Value of "COQ"Sheet
    Effort on* Production Cost-->F12 Value of "COQ"Sheet
    Effort on Appraisal Cost-->D12 Value of "COQ"Sheet
    Effort on Failure Cost-->E12 Value of "COQ"Sheet


    "Review Defects" sheet:

    Need to put value "0" Automatically when macro runs for all the "Review Defects identified by Customer/ Other Vendor"(Second cell of everymonth for all projects)


    "Design Productivity" Sheet:

    Rework Effort(exclude effort for resused test case) Column for all the Months for all the projects-->Here the macro should put the value of Sum of the F12,G12 Value of the raw data Sheet Value.



    "Design Productivity" Sheet:

    Here all the month end Cell "Test Case Preparation Productivity" Column Should Compare the previous month Productivity datas and produce the POp up message or high light the cells if it is greater than or less the 5 Percentage..

    Let us assume after Macro pull the datas into data base sheet ..then Compare all the months "Test Case Preparation Productivity" datas with previous month.Let Feb Month Compare with Jan month and produce pop up message or highlight if the deviation < or > 5%.Same for March ..like wise till december..


    "Execution Productivity" Sheet:

    Here all the month end Cell "Test Execution Productivity" Column Should Compare the previous month Productivity datas and produce the POp up message or high light the cells if it is greater than or less the 5 Percentage..

    Let us assume after Macro pull the datas into data base sheet ..then Compare all the months "Test Execution Productivity" datas with previous month.Let Feb Month Compare with Jan month and produce pop up message or highlight if the deviation < or > 5%.Same for March ..like wise till december..


    Kindly look at the above requirements and help me out..Waiting for your reply..eagarly...

    Thanks,
    Lakshmanan
    Last edited by laxmanann; 04-10-2014 at 02:45 AM.

  55. #55
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Hi all,

    I need a help of comapring values..Please refer the attached sheet in the Post # 53..

    In Design Productivity Sheet :

    The values will be calculating based on the previous sheels.Here i just want to compare the cells and generate colors of the cells.

    Jan Month data no need of color change.When the macro run for the FEB month the "Test Case Preparation Productivity" column (O) should comapre the JAn month "Test Case Preparation Productivity" and produce the color.Like wise for March month data should comapre the Feb month and generate the color.

    Colors:
    When comparing the Value of the Feb month is Greater than 5% of Jan month it should produce Green color and if it is a less than 5% it should produce the red color..

    Same thing for "Execution Productivity" Sheet..


    How can i apply the below code model in this work book
    Please Login or Register  to view this content.

  56. #56
    Forum Contributor lancer102rus's Avatar
    Join Date
    04-02-2014
    Location
    Ufa
    MS-Off Ver
    Excel 2010, 2013
    Posts
    252

    Re: List out the file names present in the folder using excel macro

    you don`t need to do this by macro. Conditional formatting can solve your problem.
    E.g. select sheet "Design Productivity". Then select range "J3:N31". Create rule for conditional formatting by menu "Home - Styles - Conditional formatting - Create rule". In opened window choose "Use a formula to determine wich cell to format". write formula in input below "=J3<(D3*0.05)" and select red color to format this cells. Press "Apply". Then again create rule to this range with formula "=J3>(D3*0.05)" and green color format. Press "Apply" and "OK".
    Those steps you need to do for every month. Example in attach
    Data Base1 v4.xlsm

  57. #57
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Dear Lancer102rus,

    Thanks for the input.But i dont want to Display colors for every cells of the ever month.Just Feb Month need to comapre the Jan month data..Like Cell O3 to O31 Cells compare the I3 to I31..Like wise for U3 to U31 comapres with I3 to I31.Like wise till end.

    When Comparing Feb month With Jan month It should procuce the colors..Please do one sample and show me boss..That is really helpful for me..


    Thanks in advance
    Lakshmanan

  58. #58
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    And When Click Import button of the MAcro the Browsing window suddenly opening here.Plese see the attached screenshot..
    Attached Files Attached Files

  59. #59
    Forum Contributor lancer102rus's Avatar
    Join Date
    04-02-2014
    Location
    Ufa
    MS-Off Ver
    Excel 2010, 2013
    Posts
    252

    Re: List out the file names present in the folder using excel macro

    Then, instead of selecting range "J3:N31", just select range "O3:O31" and use formulas "=O3<(I3*0.05)" and "=O3>(I3*0.05)"

  60. #60
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Sure Lancer ..I will check once..Please see the 58 Post alone..All is running fine..And that one alone ..need simple step or your suggestion

  61. #61
    Forum Contributor lancer102rus's Avatar
    Join Date
    04-02-2014
    Location
    Ufa
    MS-Off Ver
    Excel 2010, 2013
    Posts
    252

    Re: List out the file names present in the folder using excel macro

    Need this?
    Data Base1 v4.xlsm

  62. #62
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Dear Lancer,

    Thnaks for the help..This is what exactly i wanted...You have provided me a 4th version.After that i have made so many changes...I dont know where changed the code now for that Automatic screen path off option..Could you pleease help me/tell me the module or which steo i need to change the code..I tried with your latest code with the old one.I could not able to find it out..

  63. #63
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Dear Lancer,

    Sorry ...i found the code change..sorry for the inconvinence..Thank you buddy..god bless you always

  64. #64
    Forum Contributor lancer102rus's Avatar
    Join Date
    04-02-2014
    Location
    Ufa
    MS-Off Ver
    Excel 2010, 2013
    Posts
    252

    Re: List out the file names present in the folder using excel macro

    I just deleted last block "With tmpSh ...." in "UserForm_Activate" Sub

  65. #65
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Dear lancer ...Thank you thank you so much..hats off before your knowledge..

  66. #66
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: List out the file names present in the folder using excel macro

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  67. #67
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: List out the file names present in the folder using excel macro

    Hi Jerry,

    sorry for the delay and am closing thread as solved now.Thanks everyone.Special thanks to Lancer102rus..

+ 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. List file names in folder
    By Temporary-Failure in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-18-2013, 02:43 PM
  2. [SOLVED] VBA - folder/file names to spreadsheet list
    By Apelcius in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-12-2012, 12:03 PM
  3. List of file names & details in a folder
    By Navin Agrawal in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-04-2012, 04:02 AM
  4. List File Names From Folder
    By CobraLAD in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-30-2009, 03:51 AM
  5. Replies: 4
    Last Post: 12-28-2005, 08:50 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