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?
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?