#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Lookup?

I am using
With Worksheets(1).Range("b5:b100")
Set c = .Find("YES", LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
MsgBox c.Value & "found",vbOkOnly,"Found"
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With
to find the "yes" value in column "B"
that works fine,

is there a way to get the value in the same row only in column d?

I am wanting to use the value in column d in the message instead of the text
"YES".


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Lookup?

try:

MsgBox c.Value & " - "& c.cells(1,2).value & "found",vbOkOnly,"Found"


"David W" wrote:

I am using
With Worksheets(1).Range("b5:b100")
Set c = .Find("YES", LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
MsgBox c.Value & "found",vbOkOnly,"Found"
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With
to find the "yes" value in column "B"
that works fine,

is there a way to get the value in the same row only in column d?

I am wanting to use the value in column d in the message instead of the text
"YES".



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 186
Default Lookup?

David, this is how I would accomplish this task:

Dim Cell As Range

With Sheets(1)
For Each Cell In .Range("B5:B100")
If Cell.Value = "YES" Then
MsgBox .Range("D" & Cell.Row) & " Found!", vbOkOnly, "Found..."
End If
Next Cell
End With

Set Cell = Nothing


-Jack



"David W" wrote:

I am using
With Worksheets(1).Range("b5:b100")
Set c = .Find("YES", LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
MsgBox c.Value & "found",vbOkOnly,"Found"
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With
to find the "yes" value in column "B"
that works fine,

is there a way to get the value in the same row only in column d?

I am wanting to use the value in column d in the message instead of the text
"YES".



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default Lookup?

Simon Shaw wrote:
try:

MsgBox c.Value & " - "& c.cells(1,2).value & "found",vbOkOnly,"Found"


Slightly more efficient:

MsgBox c.Value & " - " & c(1, 3).Value & "found", vbOKOnly, "Found"

The .cells is superfluous.

Alan Beban


"David W" wrote:


I am using
With Worksheets(1).Range("b5:b100")
Set c = .Find("YES", LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
MsgBox c.Value & "found",vbOkOnly,"Found"
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With
to find the "yes" value in column "B"
that works fine,

is there a way to get the value in the same row only in column d?

I am wanting to use the value in column d in the message instead of the text
"YES".



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
lookup help. lookup result based on data in 2 columns lcc Excel Worksheet Functions 3 April 6th 10 01:20 PM
LOOKUP FUNCTION? (LOOKUP VALUE BEING A TIME RENERATED FROM A FORMU JCC Excel Discussion (Misc queries) 5 June 26th 09 09:15 PM
Matrix lookup/mulitple criteria lookup MarkFranklin Excel Discussion (Misc queries) 3 March 31st 08 10:15 AM
Get Cell Address From Lookup (Alternative to Lookup) ryguy7272 Excel Worksheet Functions 12 September 28th 07 10:36 PM
Join 2 Lists - Lookup value in 1 list & use result in 2nd lookup JBush Excel Worksheet Functions 3 January 3rd 07 11:14 PM


All times are GMT +1. The time now is 07:30 AM.

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"