Solved

Spilt unique cell

Posted on 2004-03-22
3
207 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…
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…
Suggested Courses
Course of the Month5 days, 15 hours left to enroll

626 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