![]() |
|
![]() |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
hi all again,
tryin to write a macro likely printmerge etc. now i stopped a point )) actually i can do it in VB6 but here in VBA can not succes over it. my problem is; how can i find and remove duplicate entries in listboxes? (i am gettin datas from excel sheet and listin them to two listboxes cause from excel data they comin sometimes duplicated.) finally i am close to finish and i think gonna be good work ) (apart of corel print merge, it works with images.) regards to all. |
#2
|
|||
|
|||
![]()
Bunch of ways in VB6 to do it, many use two listboxes or arrays. Just think of if the listbox as and array an treat it that way in VBA.
|
#3
|
|||
|
|||
![]()
yeah, sure i tried them all, for ex: hwnd function doesn't work over it ))) i just asked if someone has better way around it. btw thnx much for your response.
![]() |
#4
|
||||
|
||||
![]()
Hi.
I think this is what Steve was referring to: Something like this. Code:
Sub UniqueList() Dim i As Long Dim arr As Variant Dim Unique As New Collection arr = Sheet1.Range("input") For i = 1 To UBound(arr, 1) On Error Resume Next cUnique.Add arr(i, 1), CStr(arr(i, 1)) Next row ReDim arr(1 To Unique.Count, 1 To 1) For i = 1 To Unique.Count arr(i, 1) = cUnique(i) Next row Sheet1.Range("output").Resize(UBound(arr, 1), 1).Value = arr End Sub |
#5
|
|||
|
|||
![]()
thnx dear friend. infact first sight, i mean about it, when i got data already (excel, access etc, dunn matter), over form between two listboxes
![]() Last edited by olympiatr; 20-07-2010 at 14:14. Reason: mistype... |
#6
|
||||
|
||||
![]()
Hi.
I needed this same function today. Hopefully you can adapt or use my code to help. It is a simple sub that adds shapes text.character.all string to a list box as long as there is not already one with the same name there. Code:
Public Sub createLstBox(Optional nada As Boolean) saveSetSTC Dim s As Shape, sr As ShapeRange Dim c As Long, lItem As Long Dim dupBool As Boolean Set sr = ActiveSelectionRange If sr.Count = 0 Then Exit Sub On Error Resume Next 'for text in shapes!! c = 1 For c = 1 To sr.Count If sr(c).Text.Story.Characters.Count > 0 Then If lst1.ListCount = 0 Then lst1.AddItem Trim(sr(c).Text.Story.Characters.All) Else dupBool = False For lItem = 0 To lst1.ListCount - 1 If Trim(sr(c).Text.Story.Characters.All) = Trim(CStr(lst1.List(lItem))) Then dupBool = True End If Next If Not dupBool Then lst1.AddItem Trim(sr(c).Text.Story.Characters.All) End If End If Next c End Sub Last edited by runflacruiser; 26-07-2010 at 19:43. Reason: spelling fix |
#7
|
|||
|
|||
![]()
yeah, thnx dear friend. thats it indeed. when project has finished, i'll be appreciate you )) thnx again.
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Question re: CW Remove Overlap/Intersections | ajohnsonlaird | CurveWorks | 4 | 30-06-2014 10:06 |
Remove Paragraph marks from artistic text | knowbodynow | CorelDRAW/Corel DESIGNER VBA | 2 | 31-03-2006 19:48 |
How to remove extra nodes from a curve | Alex | FAQ | 1 | 23-01-2006 10:37 |
Sorting entries in the object manager | dan | CorelDRAW/Corel DESIGNER VBA | 1 | 18-08-2004 23:16 |
How to remove it? | Anonymous | CurveWorks | 2 | 30-12-2003 14:38 |