Run-time error (13) Type mismatch

solti

Board Regular
Joined
May 15, 2015
Messages
52
Hello,The following code generates a Run-time error (13) Type mismatch:

Code:
[/FONT][/COLOR]
[COLOR=#006600][FONT=Courier]Dim IloscWierszy As Long [/FONT][/COLOR]
[COLOR=#006600][FONT=Courier]IloscWierszy = Application.VLookup(.Cells(i, 2).Value, _ [/FONT][/COLOR]
[COLOR=#006600][FONT=Courier]"'[" & PlikBudżet.Name & "]" & PlikBudżet_arkusz.Name & "'!R" & WierszKosztyPensji_Budzet + 2 _ [/FONT][/COLOR]
[COLOR=#006600][FONT=Courier]& "C" & OstKol_Budzet & ":R" & WierszKosztyPracowni_Budzet - 2 & "C" & OstKol_Budzet + 1, 2, 0)
[/FONT][/COLOR]


I checked in Immediate window with Debug.? and got "Compile error:Invalid watch expression". Result of these procedure shoul be long (number 10).
What am I doing wrong?


****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">I checked Debug.? in Immediate window and gives me "Compile error:Invalid watch expression.</body>
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Hello,The following code generates a Run-time error (13) Type mismatch:

Code:
[/FONT][/COLOR]
[COLOR=#006600][FONT=Courier]Dim IloscWierszy As Long [/FONT][/COLOR]
[COLOR=#006600][FONT=Courier]IloscWierszy = Application.VLookup([B][COLOR="#FF0000"][SIZE=3].Cells[/SIZE][/COLOR][/B](i, 2).Value, _ [/FONT][/COLOR]
[COLOR=#006600][FONT=Courier]"'[" & PlikBudżet.Name & "]" & PlikBudżet_arkusz.Name & "'!R" & WierszKosztyPensji_Budzet + 2 _ [/FONT][/COLOR]
[COLOR=#006600][FONT=Courier]& "C" & OstKol_Budzet & ":R" & WierszKosztyPracowni_Budzet - 2 & "C" & OstKol_Budzet + 1, 2, 0)
[/FONT][/COLOR]


I checked in Immediate window with Debug.? and got "Compile error:Invalid watch expression". Result of these procedure shoul be long (number 10).
What am I doing wrong?

One obvious problem is the dot you have in front of the keyword "Cells" which I have outlined in red above... there is no With statement for that dot to reference so I am thinking you should just remove it.
 
Last edited:
Upvote 0
unfortunately. Nothing changes.
Procedure is part of

Code:
with ArkuszStart

<code>

end with
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,304
Members
452,633
Latest member
DougMo

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