Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Tough - show a hierarchy

It may not cause a problem, but I should have added the following line
between the end if and Next i statements.

End If
Set colTemp = New Collection '<< Add this line
Next i

"comparini3000" wrote:



"comparini3000" wrote:

My company identifies products like this: #####-###-AAA, with specific
numbers taking the place of the # sign and specific letters taking the place
of the A. the 5-digit number identifies the type of product, the 3-digit
number identifies the specific model for the type of product, and the 3
letters identify where the part was made.

I have already split the product numbers into the three components, but I
want to remove any repetitions in cell values. To show a sort of a hierarchy.
I want to go from this:

__A__ _B__ _C_
12345|123|ABC
12345|123|SDE
12345|321|RSW
54321|098|CBA
54321|890|ABC


to this:
__A__ _B__ _C_
12345|123|ABC
| |SDE
|321|RSW
54321|098|CBA
|890|ABC

how would i do that? thanks!

comparini3000


sorry, my last diagram got messed up, but all the values should line up. i
figured out a working code, it's not the most efficient, but it works:

__________________________________________________ ___________
Option Explicit
-----------------------------------------------------------------------
Sub delete_nonunique()
Dim x As Integer, I As Variant
Range("I1").End(xlDown).Select
x = Selection.Row
For Each I In Range("I2:I" & x):
If Selection.Value = ActiveCell.Offset(-1, 0).Range("A1").Value Then
Selection.ClearContents
ActiveCell.Offset(-2, 0).Range("A1").Select
x = x - 2
On Error GoTo ErrMsg
Else
x = x - 2
Range("I" & x).Select
On Error GoTo ErrMsg
End If
Next I
ErrMsg:
Range("I2").Select
End Sub
__________________________________________________ ____________

the reason i have it offset the selection by 2 is because i know the "Next
I" will select the cell below the current selection. Is there some sort of
opposite to "Next I"?

thanks

comparini3000

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
How do I set up hierarchy in Excel? LailaH Excel Discussion (Misc queries) 2 November 20th 08 05:49 PM
Hierarchy table Derrick Excel Discussion (Misc queries) 1 October 31st 08 01:53 AM
Hierarchy in excel jamshaggy New Users to Excel 1 July 23rd 06 06:49 PM
Sort by Hierarchy SpaceCamel Excel Programming 1 February 26th 06 08:52 AM
Sum in hierarchy hideki[_26_] Excel Programming 3 February 23rd 06 06:24 PM


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