Removing Duplicates
Removing Duplicates
Removing Duplicates
Removing Duplicates
Removing Duplicates
Removing Duplicates Removing Duplicates Removing Duplicates Removing Duplicates Removing Duplicates Removing Duplicates Removing Duplicates Removing Duplicates
Removing Duplicates Removing Duplicates
Removing Duplicates
Go Back  Xtreme Visual Basic Talk > > > Removing Duplicates


Reply
 
Thread Tools Display Modes
  #1  
Old 04-02-2017, 11:48 PM
deepakrx8 deepakrx8 is offline
Newcomer
 
Join Date: Apr 2017
Posts: 1
Default Removing Duplicates


Edit by Moderator: Re: Removing Duplicates
Hi Guru,

Could you please show how to pass in a dynamically populated array of object containing integers, in VB.NET?

range.RemoveDuplicates( _
Columns:=arr, _
Header:=Excel.XlYesNoGuess.xlYes)
Where arr is an array that contains integers which are populated dynamically.


=========================
Here is my attempt
---------------------------------------------------
Dynamically Creating the Array of Object containing integers.

Dim a() As Object
Dim range_array As Integer = (End_col - Start_col) + 1
'Start_col and End_col are passed in to give the starting and ending of the range.

ReDim a(range_array)
Dim i As Integer
For i = 0 To range_array
a(i) = i + 1

Next
---------------------------------
dim cd() as Object
'Version 1
' sheet is an object referring to the active sheet.

r = sheet.Range(Start_Cell &":"& End_Cell)
t = r.RemoveDuplicates columns:=(a) ' Version 1 Method1
t = r.RemoveDuplicates (columns:=(a)) ' Version 1 Method2

'Version 2
'cd = New Object(){1, 2, 3, 4}
't = r.RemoveDuplicates(cd)
t = r.RemoveDuplicates


---------------------------------------------------


Tried both Version 1 and Version 2. Not seeing any change.

I was able to perform a "r.select" using the range object and perform color changes on the range, however, when using the range object with RemoveDuplicates and the array passed, we are not getting the desired effect.

However, your method of passing the array works fine .

r.removeduplicates Columns:=New Object() {1, 2, 3, 4}

Last edited by Cerian Knight; 04-11-2017 at 02:57 PM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Removing Duplicates
Removing Duplicates
Removing Duplicates Removing Duplicates
Removing Duplicates
Removing Duplicates
Removing Duplicates Removing Duplicates Removing Duplicates Removing Duplicates Removing Duplicates Removing Duplicates Removing Duplicates
Removing Duplicates
Removing Duplicates
 
Removing Duplicates
Removing Duplicates
 
-->