get2noesks
New Member
- Joined
- Jul 15, 2015
- Messages
- 24
Hi Team,
I am getting an error while executing the code detailed below.
Private Sub Workbook_Open()
Dim WS1 As Worksheet
Dim WS2 As Worksheet
Set WS1 = Worksheets("Sheet1")
Set WS2 = Worksheets("Sheet2")
Dim testCollection As Collection
Dim SIZE As Integer, sortCol As Integer, sortRow As Integer, loopcntl As Integer
Set testCollection = getValuesToSort
'Debug.Print testCollection.Item(3)
'Debug.Print testCollection.Count
sortRow = 1
loopcntl = 1
SIZE = testCollection.Count
If SIZE <= 0 Then
MsgBox ("Nothing To Search for a sort")
End If
For loopcntl = 1 To SIZE
'MsgBox (loopCntl)
'MsgBox testCollection.Item(loopCntl)
'Call sortData(sortRow, loopCntl)
Dim completeArray() As String, arrayLeft() As String, arrayRight() As String
Dim arrayInputCntlVar As Integer, firstIndex As Integer
firstIndex = sortRow
arrayInputCntlVar = testCollection.Item(loopcntl)
Dim i As Integer
i = 0
While (WS1.Cells(sortRow + 1, arrayInputCntlVar)) <> ""
completeArray(i) = WS1.Cells(sortRow + 1, arrayInputCntlVar).ValuesortRow = sortRow + 1
i = i + 1
Wend
Dim lastIndex As Integer
lastIndex = i + 1
Call MergeSort(completeArray(), firstIndex, lastIndex)
Next loopcntl
End Sub
Regards
Saurabh
I am getting an error while executing the code detailed below.
Private Sub Workbook_Open()
Dim WS1 As Worksheet
Dim WS2 As Worksheet
Set WS1 = Worksheets("Sheet1")
Set WS2 = Worksheets("Sheet2")
Dim testCollection As Collection
Dim SIZE As Integer, sortCol As Integer, sortRow As Integer, loopcntl As Integer
Set testCollection = getValuesToSort
'Debug.Print testCollection.Item(3)
'Debug.Print testCollection.Count
sortRow = 1
loopcntl = 1
SIZE = testCollection.Count
If SIZE <= 0 Then
MsgBox ("Nothing To Search for a sort")
End If
For loopcntl = 1 To SIZE
'MsgBox (loopCntl)
'MsgBox testCollection.Item(loopCntl)
'Call sortData(sortRow, loopCntl)
Dim completeArray() As String, arrayLeft() As String, arrayRight() As String
Dim arrayInputCntlVar As Integer, firstIndex As Integer
firstIndex = sortRow
arrayInputCntlVar = testCollection.Item(loopcntl)
Dim i As Integer
i = 0
While (WS1.Cells(sortRow + 1, arrayInputCntlVar)) <> ""
completeArray(i) = WS1.Cells(sortRow + 1, arrayInputCntlVar).ValuesortRow = sortRow + 1
i = i + 1
Wend
Dim lastIndex As Integer
lastIndex = i + 1
Call MergeSort(completeArray(), firstIndex, lastIndex)
Next loopcntl
End Sub
Regards
Saurabh