Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default draw borders around deleted duplicate cells

Hello everyone
I am using the following code to remove the duplicates from a selecte
column
Sub FixDuplicateRows(
Dim RowNdx As Lon
Dim ColNum As Intege
ColNum = Selection(1).Colum
For RowNdx = Selection(Selection.Cells.Count).Row To
Selection(1).Row + 1 Step -
If Cells(RowNdx, ColNum).Value = Cells(RowNdx - 1, ColNum).Valu
The
Cells(RowNdx, ColNum).Value = "
End I
Next RowNd
End Su

I need to draw a border when the program finishes to remove
duplicate, i.e. suppose I have the following data

Brian Smit
Brian Smit
Brian Smit
John Grea
John Grea
John Grea

I need to have the following outpu
-------------
Brian Smith
Smith
Smith
-------------
John Great
Great
Great
-------------
This is urgent
Thanks in advanc
Hay
--------
Message sent via www.excelforums.com
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default draw borders around deleted duplicate cells

Sub TryThiss()
Dim X As Long
Dim Y As Long
Dim Z As Long
Dim Cell As Range

'This will give you a pink colour to all dupliocates values
'''For Each Cell In Selection
''' If Application.WorksheetFunction.CountIf(Selection, Cell)
2 Then
''' Cell.Interior.ColorIndex = 7
''' End If
'''Next Cell


'If the values are within the selected Cells in Column(1)
'First we will sort in ascending order to make easyer the job
With Selection
.Sort _
Key1:=.Cells(1), _
Order1:=xlAscending, _
Header:=xlGuess, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
X = .Columns(1).Cells(1).End(xlDown).Row
Y = .Columns(1).Cells(1).Row + 1
On Error Resume Next
For Z = X To Y Step -1
''''.Columns(1).Cells(Z).Select
If .Columns(1).Cells(Z).Value = .Columns(1).Cells(Z - 1).Valu
Then
.Columns(1).Cells(Z).BorderAround ColorIndex:=3
Weight:=xlMedium
End If
Next Z
End Wit

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default draw borders around deleted duplicate cells

Thanks for the replies but none of this codes helped
I think I need to have some variable for the cell width (that I ca
change from the code)
I would really like to use the code that I have specified
Thanks again
Hay
--------
Message sent via www.excelforums.com
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default draw borders around deleted duplicate cells

Or is there a code to draw border at a specified size, i.e
to have bordered table of 3 cells X 6 cells and have it pasted ove
the selection
--------
Message sent via www.excelforums.com
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
Deleted navigation borders DKW1609 Excel Discussion (Misc queries) 1 August 20th 07 04:36 PM
Duplicate company name to be deleted mat Excel Discussion (Misc queries) 3 November 20th 06 09:14 PM
Draw object pasted into Excel cannot be deleted or moved Elaine Merchant Excel Discussion (Misc queries) 0 January 7th 05 09:35 PM
Borders around cells Michelle Excel Programming 1 June 30th 04 06:33 PM
API to draw borders Bharath Excel Programming 3 May 7th 04 10:44 PM


All times are GMT +1. The time now is 11:54 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"