ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   HELP!!! Promelem with InStr(1, c, Sheets("TEG").Cells(i, 18), 1) (https://www.excelbanter.com/excel-programming/400985-help-promelem-instr-1-c-sheets-teg-cells-i-18-1-a.html)

Ayo

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

JE McGimpsey

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


John Bundy

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


Ayo

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



Ayo

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


JE McGimpsey

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




All times are GMT +1. The time now is 02:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com