I have no idea on where to start!!

petefa

New Member
Joined
Jul 25, 2011
Messages
13
:confused: Here's a challenge for the elite here :-)
ok I have a column and I don't know how to sort this type of data.

I have this macro, "borrowed", that kind of works on this data, but not completely.

Sub enterdata()

Dim strLastRow As String
Dim rngC As Range
Dim strToFind As String, FirstAddress As String
Dim wSht As Worksheet
Dim rngtest As String
Application.ScreenUpdating = False

Set wSht = Worksheets("Sheet2")
strToFind = InputBox("Enter the data required to find, n")

With ActiveSheet.Range("A1:B1000")
Set rngC = .Find(what:=strToFind, LookAt:=xlPart)
If Not rngC Is Nothing Then
FirstAddress = rngC.Address
Do
strLastRow = Worksheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Row + 1
rngC.EntireRow.Copy wSht.Cells(strLastRow, 1)
Set rngC = .FindNext(rngC)
Loop While Not rngC Is Nothing And rngC.Address <> FirstAddress
End If
End With

MsgBox ("Finished")

End Sub


The column consists of:-
1
1.1
1.1.2
1.1.3
1.2
1.2.1
1.2.2
1.3.1
1.3.1.1
1.3.1.2
1.3.1.3
1.3.2
1.3.2.1
1.3.2.2

If I search for "1" I get them all printed on sheet2 so far good

If I search for "1.3" I get the last seven, but I only want "the last three.

The meaning of the cell contents are:-

1.3.1 is an assembly
1.3.1.1 is part one of this assembly
1.3.1.2 is part two of this assembly
1.3.1.3 is part three of this assembly

1.3.2 is another assembly
1.3.2.1 is part one of this other assembly
1.3.2.2 is part two of this other assembly
1.3.2.3 is part three of this other assembly

This could get to 2.10.11.99 but unlikely.

Where do I start? :confused:
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

Forum statistics

Threads
1,224,521
Messages
6,179,286
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top