+ Reply to Thread
Results 1 to 7 of 7

VBA to copy data from a column with number greater than zero...???

Hybrid View

CarJon0767 VBA to copy data from a... 05-30-2013, 11:15 PM
jolivanes Re: VBA to copy data from a... 05-31-2013, 02:40 AM
CarJon0767 Re: VBA to copy data from a... 05-31-2013, 07:35 AM
jolivanes Re: VBA to copy data from a... 05-31-2013, 11:19 AM
CarJon0767 Re: VBA to copy data from a... 06-06-2013, 12:45 AM
jolivanes Re: VBA to copy data from a... 06-06-2013, 02:34 AM
CarJon0767 Re: VBA to copy data from a... 06-12-2013, 10:57 PM
  1. #1
    Registered User
    Join Date
    04-22-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    10

    VBA to copy data from a column with number greater than zero...???

    Hello Everyone and thanks in advance.

    I need help figuring out a vba code that will move data automatically from one sheet to a select range on the sheet. Here's the catch I have the data is in different columns and rows. I have made all of that data transfer over to the same column with its corresponding row/cells.

    I attached a the sheet so it makes sense.

    So if qty in parts sheet equals anything greater than zero then i need it to transfer over parts, cost and ext columns to next available row on invoice sheet range A13 through G31.

    I hope this all makes sense... Your help is greatly appreciated. thanks!!!!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,753

    Re: VBA to copy data from a column with number greater than zero...???

    Like the attached maybe.

    Sub Transfer()
        Dim lastrow As Long
        lastrow = Cells(Rows.Count, 15).End(xlUp).Row
        Application.ScreenUpdating = False
        With ActiveSheet
            .AutoFilterMode = False
            .Range("O7:O" & lastrow).AutoFilter field:=1, Criteria1:=">0"
            .Range("M8:P" & lastrow).SpecialCells(xlCellTypeVisible).Copy Sheets("Invoice").Range("A13")
            .AutoFilterMode = False
        End With
        Application.ScreenUpdating = True
    End Sub
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    04-22-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: VBA to copy data from a column with number greater than zero...???

    IT WORKS GREAT, THANKS!!! Is there any way to make it so it happens automatically instead of pressing a button? Thanks again!!!

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,753

    Re: VBA to copy data from a column with number greater than zero...???

    Automatically?
    When?
    You can do that when you open or close your workbook or when you make changes to a range of cells.

  5. #5
    Registered User
    Join Date
    04-22-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: VBA to copy data from a column with number greater than zero...???

    how can I make it if i add another item it would update? Btw the code works great!!! THANKS!!!

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,753

    Re: VBA to copy data from a column with number greater than zero...???

    Give this a try
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    04-22-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: VBA to copy data from a column with number greater than zero...???

    thanks works great!!!

+ 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