Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
im new at excel+vba scripting because the person maintaining ou scripts just packed up and left. anyway all i want to do is to make sure that certain columns do no have duplicate entries, and if there are then i want to notify the use of their locations. basically here is what i got For counter = 1 To LastRow(ThisWorkbook.ActiveSheet) Dim found As Long st1 = Range("A" & counter) found = Cells.Find(What:=st1, _ After:=Range("A" & counter), _ Lookat:=xlPart, _ LookIn:=xlFormulas, _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious, _ MatchCase:=False).Row Dim message1 As String If found = 0 And found < counter Then message1 = "Found " & st1 & " in " & Str(found) Else message1 = st1 & " of row " & Str(counter) & " not found" End If Cells(counter, 3).Value = message1 Next i am currently doing this on a test workbook. if i move the column to be checked to another column (say column B) and update the 'After parameter to reflect the change then the macro doesnt work anymore. can somebody point out what i am doing wrong? thanks. regards.. -- Message posted from http://www.ExcelForum.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Why doesnt this work? | Excel Worksheet Functions | |||
Why doesnt this work | New Users to Excel | |||
How do I stop auto-wrap-text? Unclicking in Cells doesnt work... | Excel Discussion (Misc queries) | |||
Formula doesnt work | Excel Worksheet Functions | |||
code doesnt work | Excel Programming |