By using vba.booksticle.com you agree to our cookie policy, We and our partners operate globally and use cookies, for multiple purposes

948 Steps to 6 Figures by Learning Excel-VBA and Other Skills



Step 561 - byRef argument type mismatch - syntax error


This is a common error where the type you're passing to a routine doesn't match the type the routine is expecting.

Example:



Fix

Put parenthesis around the passed parameter

FixTheCode r,c ' doesn't work ByRef argument type mismatch

FixTheCode (r),(c) ' where r and c are variants

Sub FixTheCode(r as long, c as long)

.....

End Sub


   Table of Contents | Send us your feedback | © 2025 All Rights Reserved | Edit