Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Merging duplicates in a sheet

hi,
find the lastrow in col c

Sub Stantial()
Dim rCheckCell
Dim rCell As Range
lastrow = Cells(Cells.Rows.Count, "C").End(xlUp).Row
For Each rCell In Range("C1:C" & lastrow)
sURL = rCell.Value
itotal = rCell.Offset(, 2).Value
MsgBox sURL & itotal
' Now check to see if we have a duplicate
iFlag = 1
For Each rCheckCell In Range("C" & rCell.Row + 1 & ":C" & lastrow)
sCheck = rCheckCell.Value
If sCheck = sURL Then
itotal = itotal + rCheckCell.Offset(, 2).Value
rCell.Offset(, 2).Value = itotal
rCheckCell.EntireRow.Delete
End If
Next rCheckCell
Next rCell
End Sub



"David" wrote:

On Feb 17, 11:10 am, David wrote:
Thanks Mike!


One more thing.

If I wanted to simply search through all used rows, what changes would
I need to make? The spreadsheets vary in size so always searching to
row 5000 isn't efficient.

Thanks again!

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
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 02:52 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"