Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Deleting Identical Entries
Greetings,
Fresh from my success at my first Macro (Thanks, again, Gord), I find my users have ANOTHER request. We generate a list of every part number and the figure on which it is displayed. This means the list may contain a series of entries with the same part number in the left-hand column. We've been asked to locate and delete 'multiple entries' so the left column would have the part number only on the first entry, and would be empty for the other rows that apply to that part number. We can do it by hand, though it'd be tedious. Here's what I'm trying for: Currently: Desired Part 1 A1 Part 1 A1 Part 1 D7 D7 Part 1 E5 E5 Part 1 G1 G1 Part 2 B3 Part 2 B3 Part 2 B6 B6 Part 2 D1 D1 I'm not sure what Macros are capable of, and maybe this is a question for the scripting group? Thanks, Shane |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Deleting Identical Entries
Programming would be better, but we can help.
Public Sub ProcessData() Const TEST_COLUMN As String = "A" '<=== change to suit Dim i As Long Dim iLastRow As Long With ActiveSheet iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row For i = iLastRow To 2 Step -1 If Cells(i, TEST_COLUMN).Value = Cells(i - 1, "A").Value Then Cells(i, TEST_COLUMN).Value = "" End If Next i End With End Sub -- --- HTH Bob (change the xxxx to gmail if mailing direct) "SV" wrote in message ... Greetings, Fresh from my success at my first Macro (Thanks, again, Gord), I find my users have ANOTHER request. We generate a list of every part number and the figure on which it is displayed. This means the list may contain a series of entries with the same part number in the left-hand column. We've been asked to locate and delete 'multiple entries' so the left column would have the part number only on the first entry, and would be empty for the other rows that apply to that part number. We can do it by hand, though it'd be tedious. Here's what I'm trying for: Currently: Desired Part 1 A1 Part 1 A1 Part 1 D7 D7 Part 1 E5 E5 Part 1 G1 G1 Part 2 B3 Part 2 B3 Part 2 B6 B6 Part 2 D1 D1 I'm not sure what Macros are capable of, and maybe this is a question for the scripting group? Thanks, Shane |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Deleting Identical Entries
Sure does, thanks!
"Bob Phillips" wrote in message ... Programming would be better, but we can help. Public Sub ProcessData() Const TEST_COLUMN As String = "A" '<=== change to suit Dim i As Long Dim iLastRow As Long With ActiveSheet iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row For i = iLastRow To 2 Step -1 If Cells(i, TEST_COLUMN).Value = Cells(i - 1, "A").Value Then Cells(i, TEST_COLUMN).Value = "" End If Next i End With End Sub -- --- HTH Bob (change the xxxx to gmail if mailing direct) "SV" wrote in message ... Greetings, Fresh from my success at my first Macro (Thanks, again, Gord), I find my users have ANOTHER request. We generate a list of every part number and the figure on which it is displayed. This means the list may contain a series of entries with the same part number in the left-hand column. We've been asked to locate and delete 'multiple entries' so the left column would have the part number only on the first entry, and would be empty for the other rows that apply to that part number. We can do it by hand, though it'd be tedious. Here's what I'm trying for: Currently: Desired Part 1 A1 Part 1 A1 Part 1 D7 D7 Part 1 E5 E5 Part 1 G1 G1 Part 2 B3 Part 2 B3 Part 2 B6 B6 Part 2 D1 D1 I'm not sure what Macros are capable of, and maybe this is a question for the scripting group? Thanks, Shane |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
deleting blank entries | Excel Discussion (Misc queries) | |||
Deleting All Rows for Duplicate Entries Except Those With Most Items In Row | Excel Discussion (Misc queries) | |||
Deleting duplicate entries in an Excel list | Excel Worksheet Functions | |||
Deleting duplicate entries in Excel list | Excel Discussion (Misc queries) | |||
Two identical entries in "Window" list | Excel Discussion (Misc queries) |