Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Domain Name Sorting in Excel

I was wonderig if there would be an easy way to take a group of domain
names as such:

aaa.com
bbb.com
ccc.com
aaa.net
bbb.net
ccc.net
aaa.org
bbb.org
ccc.org

then be able to create a worksheet that would but just list the .com
names in colum A, the .net names in column B, the .org names in column
C with a header for each column.

..com .net .org

Thank you in advance!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Domain Name Sorting in Excel

Assume the data you show starts in A1 of worksheet Data and you want to
write your new list to a sheet named Sheet1:

Sub efg()
Dim rng As Range, cell As Range
Dim iloc As Long, ext As String
Dim icol As Long, v As Variant
v = Array("com", "net", "org")
With Worksheets("Data")
Set rng = .Range(.Cells(1, 1), .Cells(1, 1).End(xlDown))
End With
Worksheets("Sheet1").Range("A1:C1").Value = v
For Each cell In rng
iloc = InStr(1, cell, ".", vbTextCompare)
If iloc < 0 Then
ext = LCase(Right(cell, Len(cell) - iloc))
Select Case ext
Case "com"
icol = 1
Case "net"
icol = 2
Case "org"
icol = 3
End Select
With Worksheets("Sheet1")
rw = .Cells(Rows.Count, icol).End(xlUp).Row + 1
.Cells(rw, icol).Value = cell.Value
End With
End If
Next

End Sub


--
Regards,
Tom Ogilvy


"datarancher" wrote in message
ups.com...
I was wonderig if there would be an easy way to take a group of domain
names as such:

aaa.com
bbb.com
ccc.com
aaa.net
bbb.net
ccc.net
aaa.org
bbb.org
ccc.org

then be able to create a worksheet that would but just list the .com
names in colum A, the .net names in column B, the .org names in column
C with a header for each column.

.com .net .org

Thank you in advance!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
The Domain www.bestnewsletter.eu is now for selling. The Domain for OVER 600 Million People in Europe. TAKE a LOOK !!! Excel Programming 0 June 3rd 06 04:54 PM
The Domain www.bestnewsletter.eu is now for selling. The Domain for OVER 600 Million People in Europe. TAKE a LOOK !!! Excel Programming 0 June 3rd 06 04:54 PM
I want to place excel file in some other domain. areddy[_26_] Excel Programming 1 November 23rd 05 11:23 AM


All times are GMT +1. The time now is 11:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"