LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Merging duplicates in a sheet

Hello, can anyone help with this?

I've got a table of data, basically it's rows with URLs (Col C) in it
and stats such as how many "hits" (Col E) each received.

What I need to do is search through the data and if any URLs are
duplicates, I need to remove the duplicate row while adding up the
total hits received for both rows and then writing this total back
into Col E of the original row.

This is what I have so far:

Dim rCell As Range

For Each rCell In Range("C1:C5000")

sURL = rCell.Value
iTotal = rCell.Offset(2, 0).Value

MsgBox sURL, iTotal

' Now check to see if we have a duplicate
iFlag = 1

'Range(Cells(BeginRow, BeginCol),Cells(L, col))

For Each rCheckCell In Range("C1:C5000")

sCheck = rCheckCell.Value

If sCheck = sURL Then

' We've got a match. Remove the duplicate row and add the
figures before writing them.


End If

Next rCheckCell

Next rCell

End Sub

I need the second loop to start at the row after the first loop, but I
don't know how that's done, anyone got any ideas?

If there's a better way to do this then please let me know!

Thanks.
 
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
Merging duplicate entries in Excel or deleting the duplicates (Exc guinessgirl90 Excel Worksheet Functions 1 April 2nd 09 01:06 PM
merging sheet data Dave in Ampthill[_2_] Excel Discussion (Misc queries) 1 December 17th 08 12:31 PM
Merging From One Sheet to Another LPS Excel Discussion (Misc queries) 0 July 18th 07 07:42 PM
Finding/deleting duplicates and merging cells Louise Excel Worksheet Functions 1 January 20th 06 10:36 AM
Scanning for Duplicate Data in a Column, Merging Data and Finally Removing All Duplicates...? : VB : Excel Programming 2 August 24th 03 02:22 PM


All times are GMT +1. The time now is 12:11 PM.

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

About Us

"It's about Microsoft Excel"