+ Reply to Thread
Results 1 to 3 of 3

Summary sheet - copy cell contents from multiple sheets to one summary sheet

Hybrid View

jsmity Summary sheet - copy cell... 01-21-2013, 10:02 AM
mike7952 Re: Summary sheet - copy cell... 01-21-2013, 10:10 AM
jsmity Re: Summary sheet - copy cell... 01-21-2013, 10:32 AM
  1. #1
    Forum Contributor
    Join Date
    01-28-2007
    MS-Off Ver
    2019
    Posts
    205

    Summary sheet - copy cell contents from multiple sheets to one summary sheet

    Hi,

    How would i copy contents of cell B4 for every sheet (except summary) to cell column A on the summary sheet ?
    Attached Files Attached Files
    Last edited by jsmity; 01-21-2013 at 10:33 AM. Reason: solved

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Summary sheet - copy cell contents from multiple sheets to one summary sheet

    This should do it

    Sub abc()
     Const shSummary As String = "Summary"
     Dim ws As Worksheet
     Dim aArr As Variant
     Dim i As Long
     
     ReDim aArr(1 To Worksheets.Count - 1, 1 To 2)
     For Each ws In Worksheets
        With ws
            If .Name <> shSummary Then
                i = i + 1
                aArr(i, 1) = .Cells(4, "b").Value
                aArr(i, 2) = .Cells(6, "b").Value
            End If
        End With
     Next
     With Worksheets(shSummary)
        .Cells.Delete
        .Cells(1, "a").Resize(, 2) = [{"Recipe Name", "Recipe Number"}]
        .Cells(2, "a").Resize(UBound(aArr), 2) = aArr
     End With
    End Sub
    Last edited by mike7952; 01-21-2013 at 10:14 AM.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Forum Contributor
    Join Date
    01-28-2007
    MS-Off Ver
    2019
    Posts
    205

    Re: Summary sheet - copy cell contents from multiple sheets to one summary sheet

    Thanks works

+ 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