Excel VBA runtime error 13

pedrofilipegomes

New Member
Joined
Jul 29, 2015
Messages
25
I have runtime error 13 in my file.

The error is in this code:
"
Dim i, k As Long
i = 0
k = 0
While Cells(i + 1, 1) <> ""
i = i + 1
If i = 1 Then
k = k + 1
Sheets("Final").Cells(k, 1) = Cells(i, 1)
Sheets("Final").Cells(k, 2) = Cells(i, 2)
Sheets("Final").Cells(k, 3) = Cells(i, 3)
Sheets("Final").Cells(k, 4) = Cells(i, 4)
Sheets("Final").Cells(k, 5) = Cells(i, 5)
Sheets("Final").Cells(k, 6) = Cells(i, 6)
Sheets("Final").Cells(k, 7) = Cells(i, 7)
Sheets("Final").Cells(k, 8) = Cells(i, 8)
Sheets("Final").Cells(k, 9) = Cells(i, 9)
ElseIf Cells(i, 11) <> "Não" And (Cells(i, 12) = "FUTURA" Or Cells(i, 12) = "CORRENTE" Or Cells(i, 12) = "PERMANENTE") Then
k = k + 1
Sheets("Final").Cells(k, 1) = Cells(i, 1)
Sheets("Final").Cells(k, 2) = Cells(i, 2)
Sheets("Final").Cells(k, 3) = Cells(i, 3)
Sheets("Final").Cells(k, 4) = Cells(i, 4)
Sheets("Final").Cells(k, 5) = Cells(i, 5)
Sheets("Final").Cells(k, 6) = Cells(i, 6)
If Sheets("Extract").Cells(i, 13) = "" Then
Else
Sheets("Final").Cells(k, 7) = Cells(i, 13)
End If
Sheets("Final").Cells(k, 8) = Cells(i, 8)
Sheets("Final").Cells(k, 9) = Cells(i, 9)
End If
Wend
"
The line where i have error is marked with red bold.

Anyone can help
me?

Thank's
 
If I put the formula like this:"IFERROR(INDEX(Pivot!$A:$A;MATCH(VALUE(LEFT(B16;3));Pivot!$C:$C;0));"")" the macro returns nothing..I think the problem is not solved :s
 
Last edited:
Upvote 0

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,215,844
Messages
6,127,245
Members
449,372
Latest member
charlottedv

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