Please Login or Register to view this content.
Please Login or Register to view this content.
Last edited by Paul; 03-30-2022 at 02:00 PM.
Possibly because in VBA, year is a VBA function to extract the year from a date. I'm pretty sure you can't name a variable the same as a function name.
Paul, you can name a variable with the same name as a function, but you should absolutely avoid such situations. If the variable is not declared, the compiler interprets it as a function, which may result in an error, as in this case. Compare the operation of the three procedures. It is assumed that there is no Option Explicit directive at the beginning of the module.ArtikPlease Login or Register to view this content.
Last edited by Artik; 03-30-2022 at 06:13 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks