+ Reply to Thread
Results 1 to 7 of 7

Run-time Error 5 "Invalid Procedure Call or Argument"

Hybrid View

  1. #1
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,651

    Re: Run-time Error 5 "Invalid Procedure Call or Argument"

    If there isn't a "-" in the cell.value, the Left function would error because its End argument would be -1

    Try something like this...
        If InStr(1, Cells(a, b).Value, "-") - 1 > 0 Then
            o = Left(Cells(a, b).Value, (InStr(1, Cells(a, b).Value, "-") - 1))
        End If
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  2. #2
    Registered User
    Join Date
    04-09-2014
    Location
    bangalore
    MS-Off Ver
    2010
    Posts
    15

    Re: Run-time Error 5 "Invalid Procedure Call or Argument"

    Hi
    0-10 10-20 20-30 30-40 40-50 50-60 60-70

    These are the values I have in the celss, all I am trying to do is, seperate numbers in the string, i mean 0,10,20,30 etc

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. WritetoSheet causing "invalid procedure call or argument"
    By cmb80 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-11-2013, 03:46 PM
  2. Run-time error '5': Invalid procedure call or argument
    By mcbruce76 in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 07-30-2013, 08:31 PM
  3. "Invalid procedure call or argument" error when creating Pivot table
    By Kaigi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2009, 06:02 AM
  4. [SOLVED] Run-time error '5': Invalid Procedure Call or Argument
    By Nikila in forum Excel General
    Replies: 2
    Last Post: 02-24-2006, 05:30 PM
  5. Run Time Error 5 - Invalid Procedure Call or Argument Q
    By John in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-26-2005, 05:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1