Sub CopyDataByColumnName()
    Dim wsSource As Worksheet
    Dim wsDestination As Worksheet
    Dim colSource As Range, colDest As Range

    Set wsSource = ThisWorkbook.Sheets("items")
    Set wsDestination = ThisWorkbook.Sheets("tbl_lab_setup_Test")

    ' หาคอลัมน์ที่ต้องการคัดลอกในแต่ละชีต
    Set colSource = wsSource.Columns("AX")
    Set colDest = wsDestination.Columns("AZ")

    ' คัดลอกข้อมูลจากแหล่งที่มาไปยังปลายทาง
    colSource.Copy Destination:=colDest

    ' ปิดการอ้างอิงไปยัง worksheet และ range
    Set wsSource = Nothing
    Set wsDestination = Nothing
    Set colSource = Nothing
    Set colDest = Nothing
End Sub

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: