Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default 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
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
How do I find my question? billnock Excel Discussion (Misc queries) 4 February 15th 10 07:59 AM
find question Gary Keramidas Excel Programming 1 August 18th 07 06:34 AM
how to find my question jonsey35 Excel Discussion (Misc queries) 2 August 10th 06 06:00 PM
find question Gary Keramidas Excel Programming 3 October 15th 05 03:40 AM
VBA .Find question Mark1 Excel Discussion (Misc queries) 6 December 3rd 04 08:29 PM


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

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

About Us

"It's about Microsoft Excel"