Extract Data from One Sheet to Another Using Excel VBA

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ธ.ค. 2024

ความคิดเห็น • 3

  • @HimanshuSingh-lk2my
    @HimanshuSingh-lk2my 11 หลายเดือนก่อน +1

    Typing macro in tutorial is helpful

  • @kounnaris
    @kounnaris 2 หลายเดือนก่อน

    'In this example I am Copying the Data from Sheet1 (Source) to Sheet2 (Destination)
    Sub sbCopyRangeToAnotherSheet()
    'Method 1
    Sheets("Sheet1").Range("A1:B10").Copy Destination:=Sheets("Sheet2").Range("E1")
    'Method 2
    'Copy the data
    Sheets("Sheet1").Range("A1:B10").Copy
    'Activate the destination worksheet
    Sheets("Sheet2").Activate
    'Select the target range
    Range("E1").Select
    'Paste in the target destination
    ActiveSheet.Paste
    Application.CutCopyMode = False
    End Sub

    • @exceldemy2006
      @exceldemy2006  2 หลายเดือนก่อน

      Hello @kounnaris,
      You’re demonstrating two methods for copying data from "Sheet1" to "Sheet2" using VBA. Method 1 is a straightforward one-liner, while Method 2 involves multiple steps to achieve the same result. Both methods are valid; it just depends on your coding style.
      If you have any specific questions about either method, feel free to ask! You can find more details in the original post.
      Regards
      ExcelDemy