Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem with excel invalid procedure call
Hi,
Here is the following snippet of code that is giving me a problem: If Sheet2.Cells(i, 3).Value = group Then If InStr(0, output, Sheet2.Cells(i, 4)) = 0 Then output = output & Sheet2.Cells(i, 4) & ": " & Sheet2.Cells(i, 11) & "lbs" & vbNewLine End If End If The error likes in the "If InStr..." line. On the SECOND time it iterates and hits this, I am getting an Invalid Procedure Call or Argument error. Ive tried using the textual comparison 4th argument and still no luck. Is the syntax of the InStr() function off here? Any help would be greatly appreciated. by the way, 'output', 'group' are both strings. Mike |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem with excel invalid procedure call
Mike,
InStr is based on starting at chr #1. Hence "0" is not possible. NickHK wrote in message oups.com... Hi, Here is the following snippet of code that is giving me a problem: If Sheet2.Cells(i, 3).Value = group Then If InStr(0, output, Sheet2.Cells(i, 4)) = 0 Then output = output & Sheet2.Cells(i, 4) & ": " & Sheet2.Cells(i, 11) & "lbs" & vbNewLine End If End If The error likes in the "If InStr..." line. On the SECOND time it iterates and hits this, I am getting an Invalid Procedure Call or Argument error. Ive tried using the textual comparison 4th argument and still no luck. Is the syntax of the InStr() function off here? Any help would be greatly appreciated. by the way, 'output', 'group' are both strings. Mike |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Invalid procedure call or argument error | Excel Programming | |||
Invalid Procedure call or argument | Excel Programming | |||
Run-time error '5': Invalid Procedure Call or Argument | Excel Discussion (Misc queries) | |||
Run Time Error 5 - Invalid Procedure Call or Argument Q | Excel Programming | |||
Invalid procedure call in use of Shape property?? | Excel Programming |