Run-time error 13: Type mismatch

bobkap

Active Member
Joined
Nov 22, 2009
Messages
313
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
I have a macro running through 300+ rows of data just fine then suddenly I get the Type Mismatch error and I just cannot figure out why. Here's the portion of my code that's causing this. It bombs out on the If statement. Any help would be most appreciated.

rownum = 2
counter = 2
For counter = counter To finalrowd
If Worksheets("data").Cells(rownum, paid) = "Paid" And Worksheets("data").Cells(rownum, finalcol + 4) <= Worksheets("data").Cells(rownum, salesprice) And Worksheets("data").Cells(rownum, finalcol + 3) = "WLCRdM" Then
comm2 = Worksheets("data").Cells(rownum, amount) * com2
Worksheets("data").Cells(rownum, finalcol + 2) = comm2
End If
rownum = rownum + 1
Next counter
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Can't tell for certain without knowing how you set all your variables, but one thing to check is that there's no cells in error (like #N/A) for the range you're using.
 
Upvote 0
Maybe you need to post ALL of the code.
In the code provided, you don't explain the variables....paid,finalcol,salesprice,amount !!!
 
Upvote 0

Forum statistics

Threads
1,214,991
Messages
6,122,628
Members
449,095
Latest member
bsb1122

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