+ Reply to Thread
Results 1 to 3 of 3

Importing an excel sheet into another

Hybrid View

  1. #1
    Registered User
    Join Date
    11-04-2010
    Location
    Wisconsin
    MS-Off Ver
    Excel 2003
    Posts
    1

    Importing an excel sheet into another

    Hey everyone,

    I am trying to combine a bunch of summary sheets into one main sheet and was curious as to how to approach it.

    Basically I have one common summary sheet filled in for about 100 different products. I was wondering if I could open up a new excel sheet, and somehow import the 100 different summary sheets into one large sheet.

    Any help would be greatly appreciated.

  2. #2
    Registered User
    Join Date
    08-16-2010
    Location
    us
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Importing an excel sheet into another

    Kapellu2

    Take a look at http://excel.tips.net/Pages/T003005_..._Into_One.html

    There is a macro in there that takes multiple sheets into 1 sheet.
    Read the commentary to see if that will be the best resolution

    HTH

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Importing an excel sheet into another

    That suggested code is very ineficient. try this
    Option Explicit
    
    Sub Combine()
        Dim ws As Worksheet
        Dim rRng As Range
        Dim bHeading As Boolean
        On Error Resume Next
       
        Worksheets.Add before:=Worksheets(1) ' add a sheet in first place
        ActiveSheet.Name = "Combined"
    
        ' work through sheets
        For Each ws In ThisWorkbook.Worksheets
         Set rRng = ws.UsedRange
         Select Case ws.Name
         Case "Combined" 'do nothing
          Case Else
         With Worksheets("Combined")
           If Not bHeading Then
           rRng.Copy Destination:=.Cells(.Rows.Count, 1).End(xlUp).Offset(1, 0)
           Else: rRng.Offset(1, 0).Resize(rRng.Rows.Count - 1).Copy _
           Destination:=.Cells(.Rows.Count, 1).End(xlUp).Offset(1, 0)
          End If
        End With
           bHeading = True
           End Select
        Next
        On Error GoTo 0
    End Sub
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1