Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here's a go at it...
Private Sub CommandButton1_Click() Dim DL As Worksheet Dim ML As Worksheet Dim DropRow As Integer Dim MasterRow As Integer Set DL = Sheets("DropList") Set ML = Sheets("MasterList") DropRow = 2 ' droppable names start in the 2nd row While Not IsEmpty(DL.Cells(DropRow, 1)) MasterRow = 2 ' master list starts on 2nd row While Not IsEmpty(ML.Cells(MasterRow, 1)) If ML.Cells(MasterRow, 1) = DL.Cells(DropRow, 1) And _ ML.Cells(MasterRow, 2) = DL.Cells(DropRow, 2) And _ ML.Cells(MasterRow, 3) = DL.Cells(DropRow, 3) And _ ML.Cells(MasterRow, 4) = DL.Cells(DropRow, 4) And _ ML.Cells(MasterRow, 5) = DL.Cells(DropRow, 5) And _ ML.Cells(MasterRow, 6) = DL.Cells(DropRow, 6) Then ML.Rows(MasterRow).Delete Else MasterRow = MasterRow + 1 End If Wend DropRow = DropRow + 1 Wend End Sub You'll want to customize the two sheet names and make sure my row/ column offsets match where your data resides. This macro requires that all 6 fields match up before it will delete the customer from the master list. This may or may not be what you want. You can trim down my large IF .. AND .. AND .. to suit your needs. HTH Brian Herbert Withun |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro needed | New Users to Excel | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
Macro needed to set macro security in Excel to minimum | Excel Programming | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) |