Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Search Column, If match found then add two values.

Ah that works like a charm, thank you!!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to match 2 columns, if a match found add info from 2nd column Stratton Excel Worksheet Functions 1 October 8th 08 02:55 PM
Formula to search for given term, and if not found in column to add it to list financier Excel Worksheet Functions 3 July 12th 06 03:12 PM
URGENT -- search in string for a value in another column, if found, return value from next column samkshah Excel Programming 4 October 3rd 05 04:13 PM
Search column - return row found in long text string JayL Excel Programming 1 March 5th 05 03:23 AM


All times are GMT +1. The time now is 05:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"