+ Reply to Thread
Results 1 to 10 of 10

Copy content of cells from differe excel sheet to particular cells of a single main excel

  1. #1
    Registered User
    Join Date
    02-27-2014
    Location
    chennai
    MS-Off Ver
    Excel 2007
    Posts
    6

    Copy content of cells from differe excel sheet to particular cells of a single main excel

    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.

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

    Re: Copy content of cells from differe excel sheet to particular cells of a single main ex

    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!)

  3. #3
    Registered User
    Join Date
    02-27-2014
    Location
    chennai
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Copy content of cells from differe excel sheet to particular cells of a single main ex

    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.

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

    Re: Copy content of cells from differe excel sheet to particular cells of a single main ex

    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.

  5. #5
    Registered User
    Join Date
    02-27-2014
    Location
    chennai
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Copy content of cells from differe excel sheet to particular cells of a single main ex

    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.

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

    Re: Copy content of cells from differe excel sheet to particular cells of a single main ex

    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.

  7. #7
    Registered User
    Join Date
    02-27-2014
    Location
    chennai
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Copy content of cells from differe excel sheet to particular cells of a single main ex

    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.

    Please Login or Register  to view this content.
    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.
    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.

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

    Re: Copy content of cells from differe excel sheet to particular cells of a single main ex

    Maybe this:

    Please Login or Register  to view this content.
    Notice we're trying to get those [ ] around the workbook name?

  9. #9
    Registered User
    Join Date
    02-27-2014
    Location
    chennai
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Copy content of cells from differe excel sheet to particular cells of a single main ex

    Thank you it worked..

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

    Re: Copy content of cells from differe excel sheet to particular cells of a single main ex

    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.

+ 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. [SOLVED] Copy Cells content to another sheet
    By pipoliveira in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 02-05-2014, 01:59 PM
  2. Replies: 2
    Last Post: 02-06-2013, 11:25 AM
  3. Button to copy certain cells from several excel files to a single workbook
    By yishay in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-05-2012, 03:53 AM
  4. Protect single cells in one excel sheet
    By Lausa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-11-2012, 11:19 AM
  5. Replies: 1
    Last Post: 08-14-2012, 03:42 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