Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default lookup for repeated PN

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
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
Repeated Nos vlook fomula Excel Discussion (Misc queries) 1 October 15th 09 04:52 PM
repeated value climate Excel Worksheet Functions 8 May 28th 08 05:03 PM
VLOOKUP Value that is Repeated Thomas Price[_2_] Excel Discussion (Misc queries) 5 May 19th 08 05:16 PM
Printing text in a repeated cell/row that is longer than repeated Valerie Dyet Excel Discussion (Misc queries) 1 February 13th 06 03:27 AM
Repeated row carlo Excel Discussion (Misc queries) 2 December 3rd 04 10:47 AM


All times are GMT +1. The time now is 07:58 PM.

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

About Us

"It's about Microsoft Excel"