+ Reply to Thread
Results 1 to 10 of 10

Copy and paste data

  1. #1
    Forum Contributor
    Join Date
    01-17-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    402

    Post Copy and paste data

    Hi,
    I have many files on my desktop. I have a separate excel file which has a sheet with name “Raw Data”
    I want a macro to ask me which file and which sheets data to copy to this “Raw Data” and should copy the data to that “Raw Data”. Is It possible?
    Browsing the file and sheet may help me (I think)…

    Please help..
    Last edited by kishoremcp; 05-28-2012 at 06:39 AM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Copy and paste data

    Do you want this macro to run when you open Raw Data?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: Copy and paste data

    Hi

    Upload the files... with that it will be very easy to understand the problem...
    Click *, if my suggestion helps you. Have a good day!!

  4. #4
    Forum Contributor
    Join Date
    01-17-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    402

    Re: Copy and paste data

    Yes. I will run that macro after I open the file in which "Raw Data" sheet is....

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Copy and paste data

    Can you provide me the range that needs to be copied? Or should the macro check which is the last row with data and copy accordingly? Should the headers be copied?

    Do you need the macro to ask for the sheetname to be copied? Or will there always be 1 sheet?

  6. #6
    Forum Contributor
    Join Date
    01-17-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    402

    Re: Copy and paste data

    Yes. The headers to be copied and the entire sheet to be copied. I want the macro to ask me to browse and ask for the sheet name to be copied or it can also be like display the sheet names and then I will select the requied sheet which has to be copied to Raw Data

  7. #7
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Copy and paste data

    Try this code
    Please Login or Register  to view this content.
    Press Alt+F11 on your file. On the left hand side, you will see ThisWorkbook. Double click on that and copy the above code in the right hand side code window.

    It will prompt you to open the workbook and then it will display the sheets available in the workbook that you open. By default, the first sheet name will be shown, which you can change accordingly. Then it copies the entire contents and closes the opened workbook.

    Hope this is what you are looking for.

  8. #8
    Forum Contributor
    Join Date
    01-17-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    402

    Re: Copy and paste data

    It is working good and it is working the way I want. But the only problem is it is not letting me to select the sheet name. It is listing out the sheet names and I have to type manually the required sheet name. It there any possiblity to select the sheet name also instead of typing it..?

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Copy and paste data

    I cannot explain all the steps here so am attaching what i have tried for you.

    Save this file anywhere and then open it. It will automatically prompt you for the file and proceed.
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    01-17-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    402

    Re: Copy and paste data

    Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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