ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Run-Time error, type Mismatch (https://www.excelbanter.com/excel-programming/368832-run-time-error-type-mismatch.html)

T De Villiers[_79_]

Run-Time error, type Mismatch
 

Cant see the problem at all, getting Run-Time error 13, Type mismatch
at asterixed line

Thanks

Sub printtariq()



Worksheets("Test").Select

'1) Number the columns

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("NoColour").Column
g = Cells.Find("printtype").Column
h = Cells.Find("x").Column


'2) Define last row and column
lastrow = Range("A65500").End(xlUp).Row
lastcol = Range("IV1").End(xlToLeft).Column

'3)
Cells(1, lastcol + 1) = "WoNo"
Cells(1, lastcol + 1).Font.Bold = True
i = Cells.Find("WoNo").Column
MsgBox i
MsgBox a
For y = 2 To 11
***Cells(y, i) = Right(Cells(y, a), Len(Cells(y, a) - 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=566604


Tom Ogilvy

Run-Time error, type Mismatch
 
Cells(y, i) = Right(Cells(y, a), Len(Cells(y, a)) - 1)

--
Regards,
Tom Ogilvy


"T De Villiers" wrote:


Cant see the problem at all, getting Run-Time error 13, Type mismatch
at asterixed line

Thanks

Sub printtariq()



Worksheets("Test").Select

'1) Number the columns

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("NoColour").Column
g = Cells.Find("printtype").Column
h = Cells.Find("x").Column


'2) Define last row and column
lastrow = Range("A65500").End(xlUp).Row
lastcol = Range("IV1").End(xlToLeft).Column

'3)
Cells(1, lastcol + 1) = "WoNo"
Cells(1, lastcol + 1).Font.Bold = True
i = Cells.Find("WoNo").Column
MsgBox i
MsgBox a
For y = 2 To 11
***Cells(y, i) = Right(Cells(y, a), Len(Cells(y, a) - 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=566604




All times are GMT +1. The time now is 12:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com