+ Reply to Thread
Results 1 to 2 of 2

Copy From To Macro Need Help With Adjustment

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    11-15-2007
    Location
    England
    MS-Off Ver
    Office Pro Plus 2021
    Posts
    424

    Copy From To Macro Need Help With Adjustment

    Hi

    This macro works fine for one filtered number i.e. it will copy all of the rows fom the download sheet where there is a number in column A which is equal to 60134000.

    The problem I have is that some customers have 10 + account numbers and after it has copied all of the 60134000 numbers from the download sheet to the Cust1 Sheet I want it to drop down a row on the Cust1 sheet and copy all of the 280116000 numbers underneath that and then the next and the next up to a maxium of say ten numbers.

    The start point on both sheets is A4.

    Sub CONSIGNMENT_STOCK02()
        Dim InSH As Worksheet
        Dim OutSH As Worksheet
        Dim i As Long
        
        Set InSH = Sheets("Download") ' Source Sheet
        Set OutSH = Sheets("Cust1") 'Destination Sheet
        
        Application.ScreenUpdating = False
        Application.EnableEvents = False
        OutSH.Range("A4:H55000").ClearContents ' Source Range
        
        With Intersect(InSH.UsedRange, InSH.Columns("A")) 'Source Column
            .AutoFilter 1, "60134000"
            .Offset(1).EntireRow.Copy
            OutSH.Cells(Rows.Count, "A").End(xlUp).Offset(1).PasteSpecial xlPasteValues
            .AutoFilter
        End With
        
        Application.CutCopyMode = False
        Application.EnableEvents = True
        Application.ScreenUpdating = True
        
    End Sub

  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: Copy From To Macro Need Help With Adjustment

    Do you have a sample file that you can attach?
    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]

+ 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