Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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 Su

--
T De Villier
-----------------------------------------------------------------------
T De Villiers's Profile: http://www.excelforum.com/member.php...fo&userid=2647
View this thread: http://www.excelforum.com/showthread.php?threadid=56658

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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"
wrote in message
news:T.De.Villiers.2bt62v_1154346804.7536@excelfor um-nospam.com...

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Run-time error 5


Thanks a lot Bo

--
T De Villier
-----------------------------------------------------------------------
T De Villiers's Profile: http://www.excelforum.com/member.php...fo&userid=2647
View this thread: http://www.excelforum.com/showthread.php?threadid=56658

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
Visual Basic Error Run Time Error, Type Mismatch Meg Partridge Excel Discussion (Misc queries) 12 September 10th 08 06:10 PM
Conditional Formatting - Run Time Error '13' Type Mismatch Error ksp Excel Programming 0 July 11th 06 07:06 AM
run-time error '1004': Application-defined or object-deifined error [email protected] Excel Programming 5 August 10th 05 09:39 PM
Befuddled with For Next Loop ------ Run - Time Error '13' Type Mismatch Error rdavis7408 Excel Programming 1 August 25th 04 03:54 AM
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) Tim[_36_] Excel Programming 4 April 23rd 04 02:53 AM


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