Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default HELP!!! Promelem with InStr(1, c, Sheets("TEG").Cells(i, 18), 1)

Can someone please tell me what is wrong with this line of code, the return
value is constant at zero even when the value of c is within
Sheets("TEG").Cells(i, 18)
i.e.
c = NYNYNJ3440 and,
Sheets("TEG").Cells(i, 18) = W-440 NYNYNJ3440- Midland Park DPW


Thank you.

Ayo
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default HELP!!! Promelem with InStr(1, c, Sheets("TEG").Cells(i, 18), 1)

Try:

Instr(1, Sheets("TEG").Cells(i, 18).Text, c, 1)


In article ,
Ayo wrote:

Can someone please tell me what is wrong with this line of code, the return
value is constant at zero even when the value of c is within
Sheets("TEG").Cells(i, 18)
i.e.
c = NYNYNJ3440 and,
Sheets("TEG").Cells(i, 18) = W-440 NYNYNJ3440- Midland Park DPW


Thank you.

Ayo

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 772
Default HELP!!! Promelem with InStr(1, c, Sheets("TEG").Cells(i, 18), 1)

Almost got me!! the string to search in is first, then your criteria
InStr(1,Sheets("TEG").Cells(i, 18),c, 1)
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Ayo" wrote:

Can someone please tell me what is wrong with this line of code, the return
value is constant at zero even when the value of c is within
Sheets("TEG").Cells(i, 18)
i.e.
c = NYNYNJ3440 and,
Sheets("TEG").Cells(i, 18) = W-440 NYNYNJ3440- Midland Park DPW


Thank you.

Ayo

  #4   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default HELP!!! Promelem with InStr(1, c, Sheets("TEG").Cells(i, 18),

The .Text didn't work.

"JE McGimpsey" wrote:

Try:

Instr(1, Sheets("TEG").Cells(i, 18).Text, c, 1)


In article ,
Ayo wrote:

Can someone please tell me what is wrong with this line of code, the return
value is constant at zero even when the value of c is within
Sheets("TEG").Cells(i, 18)
i.e.
c = NYNYNJ3440 and,
Sheets("TEG").Cells(i, 18) = W-440 NYNYNJ3440- Midland Park DPW


Thank you.

Ayo


  #5   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default HELP!!! Promelem with InStr(1, c, Sheets("TEG").Cells(i, 18),

Thanks a lot. That work. I am very greatful

"John Bundy" wrote:

Almost got me!! the string to search in is first, then your criteria
InStr(1,Sheets("TEG").Cells(i, 18),c, 1)
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Ayo" wrote:

Can someone please tell me what is wrong with this line of code, the return
value is constant at zero even when the value of c is within
Sheets("TEG").Cells(i, 18)
i.e.
c = NYNYNJ3440 and,
Sheets("TEG").Cells(i, 18) = W-440 NYNYNJ3440- Midland Park DPW


Thank you.

Ayo



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default HELP!!! Promelem with InStr(1, c, Sheets("TEG").Cells(i, 18),

Then you didn't have what you said you had in the cell...

In article ,
Ayo wrote:

The .Text didn't work.

"JE McGimpsey" wrote:

Try:

Instr(1, Sheets("TEG").Cells(i, 18).Text, c, 1)


In article ,
Ayo wrote:

Can someone please tell me what is wrong with this line of code, the
return
value is constant at zero even when the value of c is within
Sheets("TEG").Cells(i, 18)
i.e.
c = NYNYNJ3440 and,
Sheets("TEG").Cells(i, 18) = W-440 NYNYNJ3440- Midland Park DPW


Thank you.

Ayo


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
Sheets("Sheet1").Cells.ClearContents Seeker Excel Discussion (Misc queries) 2 October 1st 09 12:00 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Do indiv. sheets (or cells) have "TextToColumns" properties? Conan Kelly Excel Programming 2 November 1st 07 09:39 PM
Auto "copy and paste" individual cells from various sheets into one sheet ?? [email protected] Excel Discussion (Misc queries) 2 March 1st 06 03:19 AM
Using "Cells" to write "Range("A:A,H:H").Select" Trip Ives[_2_] Excel Programming 3 June 5th 04 03:13 PM


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