Solved

Spilt unique cell

Posted on 2004-03-22
3
198 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
Comment Utility
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
Comment Utility
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
Comment Utility
'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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now