Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Nov 2003
    Location
    Tampa, Florida, USA
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Append worksheets data (Excel 2003)

    I have a workbook with 105 worksheets, Sheet1, Sheet2, Sheet3,Sheet4 ..... Sheet105. The data is in two Columns : A and B. In column A is the SS# and in Column B is the name
    I need some code to append the data from each worksheet to the existing data in Sheet1starting with Sheet 2 and appending the data from each sheet to the data from the previous sheet on Sheet 1 until all of the data in on Sheet 1. The resulting Sheet 1 will have about 7,000 rows of data in two columns with no labels
    The data on each worksheet starts in Cell A1and there may be an occaisonal blank row in the sheets.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Append worksheets data (Excel 2003)

    Try this macro:

    Sub AppendData()
    Dim wshS As Worksheet
    Dim wshT As Worksheet
    Dim r As Long
    Dim m As Long
    Dim i As Integer
    Set wshT = Worksheets("Sheet1")
    For i = 2 To 105
    Set wshS = Worksheets("Sheet" & i)
    m = wshS.Range("A" & wshS.Rows.Count).End(xlUp).Row
    r = wshT.Range("A" & wshT.Rows.Count).End(xlUp).Row + 1
    wshS.Range("1:" & m).Copy Destination:=wshT.Range("A" & r)
    Next i
    End Sub

  3. #3
    Star Lounger
    Join Date
    Nov 2003
    Location
    Tampa, Florida, USA
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Append worksheets data (Excel 2003)

    Hans:
    It worked perfectly
    Thank you

Posting Permissions

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