+ Reply to Thread
Results 1 to 7 of 7

Formula to take amounts from other sheet with no duplicate amounts

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2010
    Posts
    604

    Formula to take amounts from other sheet with no duplicate amounts

    Please see attachment.

    Looking for a formula to put in the Summary sheet Column A, that looks at Column A amounts in Sheet1, 2 & 3. Puts them in this Summary sheet in Column A. If there are duplicates the amounts will not be included in the Summary sheet.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    02-13-2013
    Location
    Rogers
    MS-Off Ver
    Excel 2007
    Posts
    46

    Re: Formula to take amounts from other sheet with no duplicate amounts

    Please see sheet 1 and 2 on the attached. I believe this can be modified to fit your needs.

  3. #3
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Formula to take amounts from other sheet with no duplicate amounts

    Xx7, I'm open to correction, but I don't think you're going to get a formula to operate across multiple sheets like that. Is copying/pasting the data from each of the Column As to the Summary sheet, then using Excel's functions to remove the duplicates a runner?
    Brendan.


    __________________________________________________________________________________________________
    Things to consider:

    1) You can thank any poster by clicking the * at the left of a helpful post.
    2) You can help to keep the forum tidy by marking your thread as "Solved", if it has been answered to your satisfaction.
    3) Help us to help you, by uploading a sample workbook, showing the type of data you're dealing with, and clearly indicating what the results should be.

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Formula to take amounts from other sheet with no duplicate amounts

    Run this code in your workbook.

    The code with an ' is not running (and are not neccessary for your question).

    Sub integratie_Oeldere()
    
    'worksheetname in column A
    
    'Worksheets.Add().Name = "Consolidated"
    
    With Sheets("Summary")
        .UsedRange.ClearContents
        .Range("A1").Value = Array("Number")
    
    Sheets("Summary").Range("a2:d15000").ClearContents
    
    
      For Each sh In Sheets
      With sh
    If .Name <> "Summary" Then
         Rng = .Cells(Rows.Count, 1).End(xlUp).Row - 1
    '    Sheets("Summary").Cells(Rows.Count, 1).End(xlUp).Offset(1).Resize(Rng) = .Name
        Sheets("Summary").Cells(Rows.Count, 1).End(xlUp).Offset(1).Resize(Rng, 2) = .Range("A1").Resize(Rng, 2).Value
       End If
      End With
     Next
    
    Columns("A:A").Select
        ActiveSheet.Range("$A$1:$A$11").RemoveDuplicates Columns:=1, Header:=xlYes
        Range("A1").Select
        
    Columns("A:Z").EntireColumn.AutoFit
    End With
    End Sub
    Last edited by oeldere; 06-06-2013 at 02:38 PM. Reason: change text
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  5. #5
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Formula to take amounts from other sheet with no duplicate amounts

    For me personally I would use VBA since who knows you might have more than 200 tabs

    Sub SUmmary()
    Dim ws As Worksheet, wsSummary As Worksheet
    Dim col As Collection: Set col = New Collection
    Dim i As Long, LR As Long, j As Long
    
    Set wsSummary = ThisWorkbook.Worksheets("Summary")
    
    For Each ws In ThisWorkbook.Worksheets
        If ws.Name <> "Summary" Then
            With ws
            LR = .Cells(Rows.Count, 1).End(xlUp).Row
                For i = 1 To LR
                    On Error Resume Next
                    col.Add .Cells(i, 1).Value, CStr(.Cells(i, 1).Value)
                Next i
            End With
        End If
    Next ws
    
    With wsSummary
        .Select
        .Columns("A").ClearContents
        For j = 1 To col.Count
            .Cells(j, 1).Value = col(j)
        Next j
    End With
    
    End Sub
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2010
    Posts
    604

    Re: Formula to take amounts from other sheet with no duplicate amounts

    Great, thanks! I will use VBA. Didn't know this existed..
    ActiveSheet.Range("$A$1:$A$11").RemoveDuplicates

  7. #7
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Formula to take amounts from other sheet with no duplicate amounts

    You could change the red text in e.g.

    ActiveSheet.Range("$A$1:$A$2500").RemoveDuplicates

+ 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