bobkap
Active Member
- Joined
- Nov 22, 2009
- Messages
- 313
- Office Version
- 365
- Platform
- Windows
- Mobile
- Web
Age old problem but darned if I can figure it out. When the line with 2 asterisks runs I get a mismatch error #13. Any help would be greatly apprecaited. Here's the relevant code:
Dim statements:
VBA Code:
'Extract year only from course date
cordate = Application.match("Course Date", Range("1:1"), 0)
finalrow = Cells(Rows.Count, 1).End(xlUp).Row
For counter2 = 2 To finalrow
curdate = Cells(counter2, cordate)
**yearnum = year(curdate)
Cells(counter2, courseyear) = yearnum
Next counter2
Dim statements:
Code:
Dim curdate As Variant
Dim yearnum As Variant
Dim year As Variant