Extract Data from One Sheet to Another Using Excel VBA

Поделиться
HTML-код
  • Опубликовано: 27 янв 2025

Комментарии • 3

  • @HimanshuSingh-lk2my
    @HimanshuSingh-lk2my Год назад +1

    Typing macro in tutorial is helpful

  • @kounnaris
    @kounnaris 4 месяца назад

    '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  4 месяца назад

      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