Solved

Spilt unique cell

Posted on 2004-03-22
3
202 Views
Last Modified: 2010-05-01
Hi

I jave excel fil like this

Frame no.                      Source IP             Destination IP
1                                    192.168.1.1          192.168.1.2
2                                    192.168.1.1          192.168.1.2
3                                    192.168.1.1          192.168.1.2
4                                    192.168.1.2          192.168.1.1
5                                    192.168.1.1          192.168.1.2

The source IP will be prvided.
I need to search unique cells in the Destination IP column if the src ip provided is found in the dst ip then  i need to check the srcIP column for the value is unique or not.After doing that i need to copy all the  unique values to the  array.


Regards
Hari
0
Comment
Question by:sri_hari1986
  • 2
3 Comments
 
LVL 19

Assisted Solution

by:BrianGEFF719
BrianGEFF719 earned 500 total points
ID: 10648102
This should get you started:


Dim iCount As Integer
Dim iCcount2 As Integer
Dim ipList As Variant
Dim ip As String
ReDim ipList(0)
For iCount = 1 To 100 '100 rows, adjust as necessary
    If Sheet1.Cells(iCount, 3) <> "" Then 'assumes source of column 3
        'scan dest.
        ip = Sheet1.Cells(iCount, 3) 'again assumes source of column 3
        For icount2 = 1 To 100
            If Sheet1.Cells(iCount, 4) <> "" Then 'assumes dest of column 4
                If Sheet1.Cells(iCount, 4) = ip Then
                    'matched found!!!
                    ReDim Preserve ipList(UBound(ipList) + 1)
                    ipList(UBound(ipList)) = ip 'store to array
                End If
            End If
        Next icount2
    End If
Next iCount


'its all in an array
0
 

Author Comment

by:sri_hari1986
ID: 10648664
Hi..

Thanx for ur response..i forgot to add this..after getting the uniqye cell..i need to copy the unique rows to a differnt sheet based on the dst ip address..

Regards
Hari
0
 
LVL 19

Accepted Solution

by:
BrianGEFF719 earned 500 total points
ID: 10653094
'well loop through array and send it to a new sheet

for iCount = lbound(iplist) to ubound(iplist)
if iplist(iCount) <> "" then
 sheet2.cells(yourrow,yourcol) = iplist(ipcount)
end if
next iCount
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question