Please tell me how to copy the content of cells of different xcell files from a given directory into a single formatted xcell sheet.
Thank you in advance.hepl me please......
Please tell me how to copy the content of cells of different xcell files from a given directory into a single formatted xcell sheet.
Thank you in advance.hepl me please......
Last edited by laltoo2405; 02-27-2014 at 07:19 AM.
The macro here is where this question was removed from and placed in its own thread as per forum rules.
Based on the question above that thread and that macro seems like a perfect starting point for you. You should be able to adapt that for your needs. The parts of that macro colored are the most critical for you to change for your specific needs and workbook.
_________________
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!)
Thank you so much for quick reply.i m new to this forum and vba too.there is no explanation for serial.xlsx and recipt so could understand it .if u could explain the coding would be kind enough to solve my prob. And sir i am trying to copy form different excel files to one xcell file.if you can help this poor guy. thank u
Last edited by laltoo2405; 02-27-2014 at 01:31 PM.
The link above is the post with the macro AND the new workbook with the RECEIPT sheet and the data SERIALS sheet that user needed all together in one workbook to make it easy to create the receipts.
The code is commented to assist you in understanding what it does, line by line. As a newbie to VBA you will have to force yourself to stare at this code and comments until it clarifies to you what it does, the "how it does it" will come as you do that. We've all struggled through this, it's not rocket science, VBA was written for anyone who takes the time to understand it.
After you've spent some time with that sample workbook provided in that thread and played with the macro in there as it is currently, start to try and adapt the code to your own workbook sheet names and cell references. It's unfamiliar to you, but that will go away as you play with it more and more.
Sir i have a prob if u could give a proper solution to it... i have a textbox in excell sheet and a button beside it.when u hit the button filedialog box opens to select a directory.the selected directory's path is printed on the textbox .It is also getting all the .xls file form the directory but i want to store the files name into an array so that i could use the files names to access the files. please tell me how can i do that .Please find the code below.
----------------------------------------------------------------------Please Login or Register to view this content.
2>> how do i do rthe following-
Please Login or Register to view this content.
Last edited by JBeaucaire; 02-28-2014 at 11:59 AM. Reason: Added missing code tags. Please read the FORUM RULES, link is above in the menu bar.
When you joined the forum recently you agreed to abide by the Forum Rules, but in haste I fear you might not have actually read them. Please stop and take a moment to read them now. We all follow these rules for the benefit of all, as must you. Thanks.
(link above in the menu bar)
I've added the missing code tags, as per forum rules, to your post above.
====================
"filename" is an Excel parameter, you shouldn't use it for one of your own declared variables. Try this:
Please Login or Register to view this content.
Last edited by JBeaucaire; 02-28-2014 at 05:48 PM.
Sir i m extremely sorry i was unaware of the rules.The solution you gave is kk but for the second line ad 3rd data is directly copied without prompting asking the sheet name and file name .for the 1st line it is asking to select file name and the path.
The prob is i have array of file name from which i have import particular cell data to the current file. I am running a loop to get the cell value. 2nd line and 3rd directly copies without prompting asking to choose file name and sheet whereas 1st line does.Please Login or Register to view this content.
FolderName -containg directory path selected by user
ArrayOfFiles(i)- contains file name.
In short how to replace fixed path D:\vba\practice\[Book1.xls]Sheet1 to user choce path.
Thank You
Last edited by laltoo2405; 02-28-2014 at 05:06 PM.
Maybe this:
Notice we're trying to get those [ ] around the workbook name?Please Login or Register to view this content.
Thank you it worked..
I've marked this thread as SOLVED for you.
Next time, select Thread Tools from the links above to mark a thread as SOLVED. Thanks.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks