Home > Back-end >  One column two function, and transfer data to next sheet
One column two function, and transfer data to next sheet

Time:08-24

How to add data to Template column (from) if Transaction column O value is "From", and if Transaction column O value is "To" then it will separate to Template column (To)

Please help, i not sure how the code program. Hope can help me some. Thank you

Sheets("Transaction").Select
If Cells(lr, 17).Value = "From" Then
    Range(Cells(2, 18), Cells(lr, 18)).Select
    Selection.SpecialCells(xlCellTypeVisible).Select
    Set X = Selection
    Sheets("Template").Select
    Range("D8").Select
    X.Copy
    Selection.PasteSpecial Paste:=xlPasteValues
End If

Sheets("Transaction").Select
If Cells(lr, 17).Value = "To" Then
    Range(Cells(2, 18), Cells(lr, 18)).Select
    Selection.SpecialCells(xlCellTypeVisible).Select
    Set X = Selection
    Sheets("Template").Select
    Range("F8").Select
    X.Copy
    Selection.PasteSpecial Paste:=xlPasteValues
End If

enter image description here

  • Related