+ Reply to Thread
Results 1 to 13 of 13

Copying data into new sheet depending upon selection of rows or columns

  1. #1
    Registered User
    Join Date
    07-13-2012
    Location
    islamabad
    MS-Off Ver
    Excel 2010
    Posts
    15

    Exclamation Copying data into new sheet depending upon selection of rows or columns

    Hy. This question may be posted on other forums as well but i am unable to find out my answer. please its urgent.

    I want a macro that could

    1. Copy my selected rows or columns or cells.
    2. makes new file.xlsx
    3. pastes that data in that sheet.

    THAT'S ALL..............Please urgently waiting for macro

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

    Re: Copying data into new sheet depending upon selection of rows or columns

    Do you have a sample file that you can upload?

    To Attach a File:

    1. Click on Go Advanced.
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    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
    Registered User
    Join Date
    07-13-2012
    Location
    islamabad
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Copying data into new sheet depending upon selection of rows or columns

    i have attached file but there is no macro in it
    Attached Files Attached Files

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

    Re: Copying data into new sheet depending upon selection of rows or columns

    Should the entire data from sheet1 be copied into the new file? Or only particular rows?

  5. #5
    Registered User
    Join Date
    07-13-2012
    Location
    islamabad
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Copying data into new sheet depending upon selection of rows or columns

    Quote Originally Posted by arlu1201 View Post
    Should the entire data from sheet1 be copied into the new file? Or only particular rows?
    only particular rows. it could be any row and could be any column.

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

    Re: Copying data into new sheet depending upon selection of rows or columns

    How do you want to select the rows for copying? Is there a particular condition or conditions?

  7. #7
    Registered User
    Join Date
    07-13-2012
    Location
    islamabad
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Copying data into new sheet depending upon selection of rows or columns

    there are no conditions i just want that whenever i select single or multiple rows or columns and then run the macro it just makes another file with selected values pasted in it.

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

    Re: Copying data into new sheet depending upon selection of rows or columns

    Use this code
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose View | Macros
    Select a macro in the list, and click the Run button

  9. #9
    Registered User
    Join Date
    07-13-2012
    Location
    islamabad
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Copying data into new sheet depending upon selection of rows or columns

    Quote Originally Posted by arlu1201 View Post
    Use this code
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose View | Macros
    Select a macro in the list, and click the Run button
    its not working

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

    Re: Copying data into new sheet depending upon selection of rows or columns

    What do you mean by its not working? Are you getting any error? When you click on debug, is any error showing up?

    Are you selecting the text and then running the macro?

  11. #11
    Registered User
    Join Date
    07-13-2012
    Location
    islamabad
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Copying data into new sheet depending upon selection of rows or columns

    Quote Originally Posted by arlu1201 View Post
    What do you mean by its not working? Are you getting any error? When you click on debug, is any error showing up?

    Are you selecting the text and then running the macro?
    its giving me

    Compile Error:

    Invalid or unqualified reference

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

    Re: Copying data into new sheet depending upon selection of rows or columns

    Which row is highlighted in yellow?

  13. #13
    Registered User
    Join Date
    07-13-2012
    Location
    islamabad
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Copying data into new sheet depending upon selection of rows or columns

    Quote Originally Posted by arlu1201 View Post
    Which row is highlighted in yellow?
    i got the answer from some other forum. thankx 4 ur help.

    Please Login or Register  to view this content.
    Last edited by arlu1201; 07-13-2012 at 12:22 PM. Reason: Use code tags in future.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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