Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Spilt unique cell

Posted on 2004-03-22
3
Medium Priority
?
211 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 1500 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 1500 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…
Suggested Courses

721 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