+ Reply to Thread
Results 1 to 3 of 3

Run-time error 5

  1. #1
    Forum Contributor
    Join Date
    08-20-2005
    Posts
    171

    Run-time error 5

    Hi, running the code and at asterixed line am getting:
    Run-time error '5': Invalid prcedure call or argument

    Many Thanks


    ****

    Sub printtariq()

    Worksheets("Test").Select


    a = Cells.Find("WorkOrder").Column
    b = Cells.Find("CostC").Column
    c = Cells.Find("PaperSize").Column
    d = Cells.Find("PaperWeight").Column
    e = Cells.Find("NoBW").Column
    f = Cells.Find("printtype").Column

    lastrow = Range("A65500").End(xlUp).Row
    lastcol = Range("IV1").End(xlToLeft).Column
    Cells(1, lastcol + 1) = "x"
    Cells(1, lastcol + 1).Font.Bold = True
    g = Cells.Find("x").Column

    'For i = 2 To lastrow
    'Cells(i, g) = Right(Cells(i, a), Len(Cells(i, a)) - 1)
    'Next



    'Cells(2, 9) = Replace(Cells(2, 1), 1, 1, "S")

    Worksheets("MORI").Select
    z = Cells.Find("Job No").Column
    firstrowmori = Cells.Find("Job No").Row
    'MsgBox z

    lastrowmori = Cells(65000, z).End(xlUp).Row

    Cells(26, z).EntireColumn.Select
    Selection.Insert Shift:=xlToRight

    Cells(22, 8).Select

    ***Cells(22, z - 1) = Right(Cells(22, z), Len(Cells(22, z)) - 1)
    'Next
    End Sub

  2. #2
    Bob Phillips
    Guest

    Re: Run-time error 5

    Cells(22, z - 1) = Right(Cells(22, z), Len(Cells(22, z) - 1))


    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "T De Villiers" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Hi, running the code and at asterixed line am getting:
    > Run-time error '5': Invalid prcedure call or argument
    >
    > Many Thanks
    >
    >
    > ****
    >
    > Sub printtariq()
    >
    > Worksheets("Test").Select
    >
    >
    > a = Cells.Find("WorkOrder").Column
    > b = Cells.Find("CostC").Column
    > c = Cells.Find("PaperSize").Column
    > d = Cells.Find("PaperWeight").Column
    > e = Cells.Find("NoBW").Column
    > f = Cells.Find("printtype").Column
    >
    > lastrow = Range("A65500").End(xlUp).Row
    > lastcol = Range("IV1").End(xlToLeft).Column
    > Cells(1, lastcol + 1) = "x"
    > Cells(1, lastcol + 1).Font.Bold = True
    > g = Cells.Find("x").Column
    >
    > 'For i = 2 To lastrow
    > 'Cells(i, g) = Right(Cells(i, a), Len(Cells(i, a)) - 1)
    > 'Next
    >
    >
    >
    > 'Cells(2, 9) = Replace(Cells(2, 1), 1, 1, "S")
    >
    > Worksheets("MORI").Select
    > z = Cells.Find("Job No").Column
    > firstrowmori = Cells.Find("Job No").Row
    > 'MsgBox z
    >
    > lastrowmori = Cells(65000, z).End(xlUp).Row
    >
    > Cells(26, z).EntireColumn.Select
    > Selection.Insert Shift:=xlToRight
    >
    > Cells(22, 8).Select
    >
    > ***Cells(22, z - 1) = Right(Cells(22, z), Len(Cells(22, z)) - 1)
    > 'Next
    > End Sub
    >
    >
    > --
    > T De Villiers
    > ------------------------------------------------------------------------
    > T De Villiers's Profile:

    http://www.excelforum.com/member.php...o&userid=26479
    > View this thread: http://www.excelforum.com/showthread...hreadid=566588
    >




  3. #3
    Forum Contributor
    Join Date
    08-20-2005
    Posts
    171
    Thanks a lot Bob

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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