Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find rows with a common item and find or highlight difference | Excel Programming | |||
Find and Replace - delete the remainder of the text in the cell after my Find | Excel Programming | |||
Find First Non blank cell than find column header and return that value | Excel Worksheet Functions | |||
find and delete duplicate entries in two columns or find and prin. | Excel Programming | |||
find and delete text, find a 10-digit number and put it in a textbox | Excel Programming |