+ Reply to Thread
Results 1 to 6 of 6

Macro for copy/paste if ""

  1. #1
    Registered User
    Join Date
    05-29-2012
    Location
    Kansas
    MS-Off Ver
    Excel 2007
    Posts
    14

    Macro for copy/paste if ""

    Good morning all, I am having troubles developing a macro that will check multiple sheets and then dump any qualifying data into a designated workbook on the next available line.
    What I would like the button/macro to perform is :

    On Sheets 1-31, IF column "AJ">2, copy the corresponding row and paste in workbook "SARC" on the next available line.

    Thanks in advance

  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: Macro for copy/paste if ""

    Do you need the sheetname / sheetnumber to be copied alongside the row to identify from which sheet the data has come?
    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
    05-29-2012
    Location
    Kansas
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Macro for copy/paste if ""

    No one of the columns carries this information.

    Thanks

  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: Macro for copy/paste if ""

    Try this
    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
    Last edited by arlu1201; 08-14-2012 at 09:30 AM.

  5. #5
    Registered User
    Join Date
    05-29-2012
    Location
    Kansas
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Macro for copy/paste if ""

    Arlette, thanks for the code, but I believe that I misspoke in my initial post.

    I need a macro to check worksheets "1,2,3....31" IF anything in column "AJ" is>2, then copy and paste to worksheet "SARC" on the next available line.

    When I tried your initial macro it occured a run time error.

  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: Macro for copy/paste if ""

    What is the error you received? Which line was highlighted when you clicked on Debug on the error popup?

    I have edited the code above to take care of the sheet names from 1 to 31.

+ 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