Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default 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
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
Invalid procedure call or argument error Patrick Simonds Excel Programming 1 August 12th 06 11:40 PM
Invalid Procedure call or argument T De Villiers[_58_] Excel Programming 1 July 25th 06 03:01 PM
Run-time error '5': Invalid Procedure Call or Argument Nikila Excel Discussion (Misc queries) 2 February 24th 06 09:26 PM
Run Time Error 5 - Invalid Procedure Call or Argument Q John[_110_] Excel Programming 3 September 26th 05 09:47 PM
Invalid procedure call in use of Shape property?? No Name Excel Programming 2 August 26th 04 12:52 AM


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