#1
|
|||
|
|||
how to check for duplicated words / cells ?
hallo everybody !
I am using word 2013 for making database tables for some items and its counting .On inserting so many items , there will be items inserted twice or more ! Is there any way to detect duplicate items ?Actually i can't use find & replace because i don't know definitly duplicated items , that what i want to know ( detecting duplicate words in the document ).Thanks |
#2
|
||||
|
||||
The burning question is why are you using Word to create a 'database', when Excel will do the job so much better and will make it easier to spot the duplicates you fear?
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
Quote:
I prefer using word than exel because it isn't only databases what i do , i am writing full documents with tables ,charts ,pictures and paragraphs . So word is the best for my work . |
#4
|
|||
|
|||
isn't there any help ! :-(
|
#5
|
||||
|
||||
There is plenty of help but you haven't described adequately what you want to do. Be specific about your problem and perhaps post a sample document.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#6
|
|||
|
|||
Quote:
http://oi62.tinypic.com/nygoyv.jpg Is there any option in word to highlight duplicated words ? |
#7
|
||||
|
||||
There is no built-in option in Word to highlight duplicate 'words'. There is in Excel but you already discounted that suggestion earlier.
It appears that you are not actually looking for duplicate words but appear to be looking for duplicate cell contents. We probably need to assume that you don't need to find multiple dose sizes (as alluded to by the contents of the first row) and that the first column of numbers is manually entered rather than being autonumbers, then a macro based on the following principles would do the job. 1. Sort the table based on column 2 2. Query the cell contents in column 2 and highlight the cells where the cell contents match the cell above. 3. Re-sort the table based on column 1 to get the table back in the original order
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#8
|
|||
|
|||
Quote:
Thank you very much for your help |
#9
|
||||
|
||||
There is no simple alternative while you use Word, but you can automate it with a macro that performs the steps e.g.
Code:
Sub CheckDuplicates() Dim oTable As Table Dim oCell1 As Range, oCell2 As Range Dim i As Long If Not Selection.Information(wdWithInTable) Then Beep MsgBox "The cursor is not in a table?" GoTo lbl_Exit End If Set oTable = Selection.Tables(1) oTable.Sort ExcludeHeader:=False, FieldNumber:="Column 2", _ SortFieldType:=wdSortFieldAlphanumeric, SortOrder:=wdSortOrderAscending DoEvents For i = 2 To oTable.Rows.Count - 1 Set oCell1 = oTable.Rows(i).Cells(2).Range oCell1.End = oCell1.End - 1 Set oCell2 = oTable.Rows(i + 1).Cells(2).Range oCell2.End = oCell2.End - 1 If oCell1.Text = oCell2.Text Then oCell1.HighlightColorIndex = wdYellow oCell2.HighlightColorIndex = wdYellow End If Next i oTable.Sort ExcludeHeader:=False, FieldNumber:="Column 1", _ SortFieldType:=wdSortFieldNumeric, SortOrder:=wdSortOrderAscending lbl_Exit: Set oTable = Nothing Set oCell1 = Nothing Set oCell2 = Nothing Exit Sub End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#10
|
|||
|
|||
Quote:
But how can i use this ? |
#11
|
||||
|
||||
See http://www.gmayor.com/installing_macro.htm
Then insert the cursor in the table and run the macro.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#12
|
|||
|
|||
Quote:
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding words to spell check dictionary | oakwoodbank | Word | 17 | 02-27-2015 08:09 PM |
Check for duplicated data and print list | cjharley | Excel | 2 | 12-19-2014 11:44 PM |
Words are being duplicated in text boxes | argentraven | PowerPoint | 0 | 07-24-2014 03:10 PM |
Spell check adding words | riweir | Word | 3 | 11-30-2011 09:03 PM |
Words are duplicated on print | agentred | Word | 1 | 06-29-2010 08:45 AM |