• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Copy and Paste WBook to WBook with <> Match Text

Hi All,

Pls Help in this Macro.

In Macro File i have written a Code to update "ET/ST" that is working fine. (Note - it doesn't take data from input file)
But Now in that input file <>"ET / ST" there are some other Unit available like "PK-Pack, CS-Case, CT-Carton, Etc..",
enclosed input file for reference.

what i need is other that "ET/ST" any unit in input file should update in last row and copying the entire column from ("C:N") in macro file its possible.

This is the code that update ET/ST

Code:
Dim x As Workbook
Dim y As Workbook
Dim pat As Variant
Dim lr1, lr2 As Long
Dim lrow As Long
Dim i As Long
Dim ws As Worksheet
Dim RangeName As Name
Code:
'insert row for duplicate record MARM 2 records Alternative UOM
Sub Insert_Row_MARM()
Dim L&, N%
Dim y As Workbook

Set y = ThisWorkbook
y.Activate
    With [MARM!A1].CurrentRegion.Rows
        L = .Count + 1
    For N = 1 To 1
       .Item("5:" & .Count).Copy .Item(L)
        L = L + .Count - 4
    Next
       .Item("5:" & L - 1).Sort .Cells(5, 1), 1, Header:=2
    End With
Call copy_Paste_MARM
'Call MVKE_delete_Last_ROW
End Sub
'---------------------------------------------------------------------------'
'copy and paste plant for MARM Alternative UOM
Sub copy_Paste_MARM()

        Dim R&
    With [MARM!A1].CurrentRegion
        For R = 5 To .Rows.Count Step 2
      
            [CODE!G2:G3].Copy .Cells(R, 2)
        Next
    End With
 
End Sub
 

Attachments

Top