Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sheets("Sheet1").Cells.ClearContents | Excel Discussion (Misc queries) | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Do indiv. sheets (or cells) have "TextToColumns" properties? | Excel Programming | |||
Auto "copy and paste" individual cells from various sheets into one sheet ?? | Excel Discussion (Misc queries) | |||
Using "Cells" to write "Range("A:A,H:H").Select" | Excel Programming |