Consulting

Results 1 to 3 of 3

Thread: Macro to combine output of two sheet into one

  1. #1
    VBAX Regular
    Joined
    Apr 2012
    Posts
    22
    Location

    Macro to combine output of two sheet into one

    I have two excel sheet in D:/sheet1.xls, D:/sheet2.xls. I want to copy the data from second row of sheet 1 and 2 to a new sheet (D:/sheet3.xls) to the last row where data is empty
    if sheet 3 contain 200 records, then the output of sheet 1 start from 201 records upto last, followed by sheet2 data.

    I am new, Can anybody help me in writing the macro.

  2. #2
    VBAX Mentor
    Joined
    Feb 2009
    Posts
    493
    Location
    When you say sheets I assume you mean the first sheet in each workbook and you want 3 separate workbooks correct?

    Where do you want to run this code from? A separate workbook or the first workbook?
    -----------------------------------------
    The more you learn about something the more you know you have much to learn.

  3. #3
    VBAX Regular
    Joined
    Apr 2012
    Posts
    22
    Location
    thanks for your response
    Yes sheet 3 is the main sheet, where I want to run macro so that data of sheet 1 and sheet2 are copied from second rows and paste into sheet3
    I am able to work in the same sheet but not different one
    Sub pp()
    Dim ws As Worksheet

    Application.ScreenUpdating = False
    Sheets("Sheet4").Activate

    For Each ws In Worksheets
    If ws.Name <> "sheet4" Then
    selection.Copy
    ActiveSheet.Paste Range("A65536").End(xlUp).Offset(1, 0)
    End If
    Next ws
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •