Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
find question on vba
Hi All
I define two find 1. Find Key 2. Find Item In find key, the cell formula is =G2&"|"&V3&"|"&J2. I check the data, the find can not able to find a key value. The key value is on target sheet. But the find return nothing. What is the problem on data case return nothing ? With GP_WK.Sheets(MES.SHT_Name).Range(MES.KEY_RANGE) Set Rng_KEY = .Find(What:=GPD_KEY_VAL, _ After:=.Cells(1), _ LookIn:=xlValue, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) End With With GP_WK.Sheets(MES.SHT_Name).Range(MES.ITEM_RANGE) Set Rng_ITEM = .Find(What:=GPD_ITEM_VAL, _ After:=.Cells(1), _ LookIn:=xlValue, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) End With If Not Rng_ITEM Is Nothing And Rng_KEY Is Nothing Then ...... |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
find question on vba
I am assuming that GPD_KEY_VAL is a defined name of a cell. If so then try
the following. Set Rng_KEY = .Find(What:=Range("GPD_KEY_VAL").Value, _ After:=.Cells(1), _ LookIn:=xlValue, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) Regards, OssieMac Regards, Regards, OssieMac "moonhk" wrote: Hi All I define two find 1. Find Key 2. Find Item In find key, the cell formula is =G2&"|"&V3&"|"&J2. I check the data, the find can not able to find a key value. The key value is on target sheet. But the find return nothing. What is the problem on data case return nothing ? With GP_WK.Sheets(MES.SHT_Name).Range(MES.KEY_RANGE) Set Rng_KEY = .Find(What:=GPD_KEY_VAL, _ After:=.Cells(1), _ LookIn:=xlValue, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) End With With GP_WK.Sheets(MES.SHT_Name).Range(MES.ITEM_RANGE) Set Rng_ITEM = .Find(What:=GPD_ITEM_VAL, _ After:=.Cells(1), _ LookIn:=xlValue, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) End With If Not Rng_ITEM Is Nothing And Rng_KEY Is Nothing Then ...... . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I find my question? | Excel Discussion (Misc queries) | |||
find question | Excel Programming | |||
how to find my question | Excel Discussion (Misc queries) | |||
find question | Excel Programming | |||
VBA .Find question | Excel Discussion (Misc queries) |