Solved

Spilt unique cell

Posted on 2004-03-22
3
203 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

840 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