Pike
Excellent Job by you.
I've downloaded the file "Sutures-Revised(2).xlsm" from
http://www.ozgrid.com/forum/showthread.php?t=196314 "Displaying Groupwise"
i've similar type of requirement.
Suppose I want to Merge and Centre a Range of Cells which are in column 6 but are in the following Array
As i see the Qty is being repeated. So i would like to merge the Cells and centre and put a Value of Qty in that range of Column6 for those products selected
Code
Private Sub cmdDisplaySelectedRecords_Click()
Dim SelectedArray(), SelectedArrayDisplay()
Dim lngRecord As Long, lngSet As Long, intItem As Long, arrayCount As Long, checkItem As Long
Dim rw As Long, jw As Long, arrayCountDisplay As Long
With Sheets("sheet3")
.Activate
End With
If lngCount > 0 Then
RecordSet = True
ReDim SelectedArray(1 To lngCount + (mylist.Count * 2), 1 To 8)
ReDim SelectedArrayDisplay(1 To lngCount, 1 To 8)
For lngRecord = 1 To mylist.Count
If mylist(lngRecord).Count > 0 Then
arrayCount = arrayCount + 1
SelectedArray(arrayCount, 1) = mylist(lngRecord).Item(1)(0)
For lngSet = 1 To mylist(lngRecord).Count
arrayCountDisplay = arrayCountDisplay + 1
arrayCount = arrayCount + 1
For intItem = 1 To 7
SelectedArray(arrayCount, intItem) = mylist(lngRecord).Item(lngSet)(intItem)
SelectedArrayDisplay(arrayCountDisplay, intItem) = mylist(lngRecord).Item(lngSet)(intItem - 1)
Next
rw = rw + 1
Next
arrayCount = arrayCount + 1
End If
Next
listSutures.List = SelectedArrayDisplay
Sheet3.Range("B1").Resize(, 6) = Array("Code No", "Description", "UOM/Pack", "Price", "Qty", "Total")
Sheet3.Range("A2").Resize(lngCount + (mylist.Count * 2), 7).Value = SelectedArray
End If
End Sub
Display More
1. Do we need to find out the coulmn if yes then how do we find the column and code in the below procedure ?
or
2. How can we code it directly ?
Thanks
Sam D'souza