Error 13 type mis match windows only.

adamprocter

Board Regular
Joined
Apr 13, 2015
Messages
53
Code works fine on my mac however it has started failing on windows macs with a type mis match pointing to this line

Code:
  If Sheets("Dashboard").Range("I3") < Sheets("Dashboard").Cells(lNextRow, "M") Then

INextRow is declared as a Long and is used in lines before this one so I am a little lost and also have less access to windows machines so I am finding it hard to debug ?
Any ideas ?

Here is some more code around it

Code:
    'Dashboard population script follows
Dim ws As Worksheet
Dim sName As String
Dim Value As String
Dim lLastRow As Long
Dim lNextRow As Long
Dim rcMatch As Variant

Application.ScreenUpdating = False

....

Set MyRange = Sheets("Dashboard").Range("H6:I" & ILastRow)
For Each c In MyRange

Select Case True
                Case c.Value = "One"

               'if BEP is above current BEP green
             If Sheets("Dashboard").Range("I3") < Sheets("Dashboard").Cells(lNextRow, "M") Then
          
                    
                          Sheets("Dashboard").Cells(lNextRow, "I").Copy
                    Sheets("Dashboard").Cells(lNextRow, "AS").PasteSpecial Paste:=xlPasteValues
                                             
                        Else
                         Sheets("Dashboard").Cells(lNextRow, "AS").ClearContents
                         
                          Sheets("Dashboard").Cells(lNextRow, "I").Copy
                    Sheets("Dashboard").Cells(lNextRow, "AT").PasteSpecial Paste:=xlPasteValues
                            
             End If

  Case c.Value = "Two"

....
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
When it errors what is the value of lNextRow when you hover your mouse over it?
 
Upvote 0
Most likely cause is that one of those cells has an error in it.
 
Upvote 0

Forum statistics

Threads
1,216,138
Messages
6,129,099
Members
449,486
Latest member
malcolmlyle

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top