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

Hi,

I am very confused why this code doesn't work. In the
watch window the text value is the same as the
line1.offset value but the if statements is never excuted.

For Each line1 In Category.Cells
If (line1.Offset(0, 1).Value = text) Then
TotalExist = True
Exit For
End If
Next line1

Thank you in advance,
LC
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Searching

LC
Unless text is a variable name
If (line1.Offset(0, 1).Value = "text") Then
should work.

HTH
Henry

"LC" wrote in message
...
Hi,

I am very confused why this code doesn't work. In the
watch window the text value is the same as the
line1.offset value but the if statements is never excuted.

For Each line1 In Category.Cells
If (line1.Offset(0, 1).Value = text) Then
TotalExist = True
Exit For
End If
Next line1

Thank you in advance,
LC



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
Searching for... FC Excel Discussion (Misc queries) 2 October 13th 07 04:31 PM
Searching for #N/A [email protected] Excel Worksheet Functions 5 February 28th 07 01:23 PM
Searching, matching then searching another list based on the match A.S. Excel Discussion (Misc queries) 1 December 13th 06 05:08 AM
searching for tab Kevin R Excel Discussion (Misc queries) 3 January 16th 06 08:55 PM
Searching the first name only Kelly Lim Excel Discussion (Misc queries) 7 June 17th 05 04:31 AM


All times are GMT +1. The time now is 11:20 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"