Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search Column, If match found then add two values.
Hello all,
Ive found this group extremely useful before, so I thought id ask a question of my own since I cant find anything to help or come up with anything that solves it myself. I have a sheet that lists who watched our online event with the times theyve logged in and out, sometimes you can have multiple connections from one person but I want them considered as the same person with the total viewing shown. I would like to search by the FullName field(The only unique field I have) and if it finds a match then I want to add the total time watched values, sometimes the names are way down the column. So I want to search D(fullname), If match then add the values from the cells in the row the match was found but on column L(total time) together with the original and then delete the duplicate row if possible. Any help would be most appreciated Yours S MacKintosh |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search Column, If match found then add two values.
Sub SumAndDelete()
Dim c As Range Dim rng As Range Dim iEnd As Long Dim iCt As Long Dim ws As Worksheet Set ws = Sheets("Sheet1") iEnd = ws.Range("D1").End(xlDown).Row Set rng = ws.Range("D2:D" & iEnd) For Each c In rng For iCt = iEnd To c.Row + 1 Step -1 If c = ws.Range("D" & iCt) Then c.Offset(0, 8) = c.Offset(0, 8) + ws.Range("L" & iCt) ws.Rows(iCt).Delete End If Next iCt Next c End Sub Hth, Merjet |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search Column, If match found then add two values.
Ah that works like a charm, thank you!!
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need to match 2 columns, if a match found add info from 2nd column | Excel Worksheet Functions | |||
Formula to search for given term, and if not found in column to add it to list | Excel Worksheet Functions | |||
URGENT -- search in string for a value in another column, if found, return value from next column | Excel Programming | |||
Search column - return row found in long text string | Excel Programming |