Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Sir,
i am trying to do a macro that searches for repeated PN value from my daily kept log (col C) so that those previously done can be detected and not redo the PN again for the next day. I tried the follwing lines but all returns "N" value(Col L) even when i have repeated PN on Column K("k1")which proves that the macro is not functioning. How to make sure that one cell value are checked throughout the whole col C before the next cell(K2..K3..K4..) ? Is there other alternate ways other than use VLOOKUP coz for Vlookup does not work for me..i want something that not only check row on row. but one row("K1") to all the other rows(Col C) *note: all the kvalues are not the same. Once again, a million thanks for your help. Cheers=) Example: 'Application.ScreenUpdating = False Sub SearchRepeatPNs() Range("A65536").Select Selection.End(xlUp).Select NumOfRows = ActiveCell.Row Sheets("Sheet1").Select Range("K2").Select 'Specify ActiveCell 'Start of Loop For CurrentRow = 2 To NumOfRows PN$ = Cells(CurrentRow, 11) 'column K Repeat$ = Cells(CurrentRow, 12) 'column L 'Range("L" & CurrentRow).Select Repeat$ = "=IF(VLOOKUP(PN$),Sheet1!C2:C65536,1,FALSE),1,VLOO KUP(PN$,Sheet1!C1:C63356,1,FALSE))" If Trim(PN$) = Trim(Repeat$) Then 'Match Value Found Cells(CurrentRow, 12) = "Y" Else Cells(CurrentRow, 12) = "N" End If Next MsgBox ("BINGO!!!END MACRO") End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Repeated Nos | Excel Discussion (Misc queries) | |||
repeated value | Excel Worksheet Functions | |||
VLOOKUP Value that is Repeated | Excel Discussion (Misc queries) | |||
Printing text in a repeated cell/row that is longer than repeated | Excel Discussion (Misc queries) | |||
Repeated row | Excel Discussion (Misc queries) |