LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Find then Sum

On Nov 9, 4:19*pm, joel wrote:
the store customer counts are on sheet 1. *I put the following table in
sheet 2 :

6 * * * 200
10 * * *132
15 * * *1001

Sub UpdateStores()

With Sheets("Sheet2")
RowCount = 1
Do While .Range("A" & RowCount) < ""
OldStore = .Range("A" & RowCount)
NewStore = .Range("B" & RowCount)
With Sheets("Sheet1")
FoundStore = True
Set c = .Columns("A").Find(what:=OldStore, _
LookIn:=xlValues, lookat:=xlWhole)
If c Is Nothing Then
MsgBox ("Cannot find Old Store : " & OldStore)
FoundStore = False
End If
Set c1 = .Columns("A").Find(what:=NewStore, _
LookIn:=xlValues, lookat:=xlWhole)
If c1 Is Nothing Then
MsgBox ("Cannot find New Store : " & NewStore)
FoundStore = False
End If
If FoundStore = True Then
OldCount = c.Offset(0, 1)
NewCount = c1.Offset(0, 1)
c1.Offset(0, 1) = OldCount + NewCount
c.EntireRow.Delete
End If
End With
RowCount = RowCount + 1
Loop
End With
End Sub

--
joel
------------------------------------------------------------------------
joel's Profile:http://www.thecodecage.com/forumz/member.php?userid=229
View this thread:http://www.thecodecage.com/forumz/sh...d.php?t=152457

Microsoft Office Help


Works like a charm. 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
Find rows with a common item and find or highlight difference jonnybrovo815 Excel Programming 2 February 27th 08 12:56 AM
Find and Replace - delete the remainder of the text in the cell after my Find [email protected] Excel Programming 4 August 4th 07 03:39 AM
Find First Non blank cell than find column header and return that value Silver Rose Excel Worksheet Functions 10 April 30th 07 05:56 PM
find and delete duplicate entries in two columns or find and prin. campare 2 columns of numbers-find unique Excel Programming 1 November 24th 04 04:09 PM
find and delete text, find a 10-digit number and put it in a textbox Paul Excel Programming 3 November 16th 04 04:21 PM


All times are GMT +1. The time now is 11:02 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"