xcelnovice
Board Regular
- Joined
- Dec 31, 2011
- Messages
- 81
Hi, I inherited a macro & it has worked in previous months but this month I am getting the data type mismatch error. I've done some digging & understand that is telling me its an unrecognized data type but I wanted to post the code to see if anyone sees somenthin obvious...theres a ton more code to this macro so I doubt it will be solvable but it was worth a shot...
Sub Step_2()</SPAN>
Dim JEMonth As Byte</SPAN>
Dim JEYear As Integer</SPAN>
JEMonth = Sheets("MGR Data").Cells(2, 2).Value 'This is highlighted in yellow & where I get the error'</SPAN></SPAN>
JEYear = Sheets("MGR Data").Cells(2, 1).Value</SPAN>
Dim dtmDate As Date</SPAN>
Dim JEDate As Date</SPAN>
dtmDate = JEMonth & "/1/" & JEYear</SPAN>
JEDate = DateSerial(Year(dtmDate), _</SPAN>
Month(dtmDate) + 1, 0)</SPAN>
UserForm1.JD.Value = JEDate</SPAN>
UserForm1.Show</SPAN>
End Sub
& to see if i understand what I am seeing...first to lines declare variable. 2nd 2 lines are saying the variables are the MGR Data sheet w/ in the workbook, from A1 go down 2 cells & Over 2 cells & return that value (which is 7000-01)
And any code after this is a mystery to me at this point...Thanks</SPAN>
Sub Step_2()</SPAN>
Dim JEMonth As Byte</SPAN>
Dim JEYear As Integer</SPAN>
JEMonth = Sheets("MGR Data").Cells(2, 2).Value 'This is highlighted in yellow & where I get the error'</SPAN></SPAN>
JEYear = Sheets("MGR Data").Cells(2, 1).Value</SPAN>
Dim dtmDate As Date</SPAN>
Dim JEDate As Date</SPAN>
dtmDate = JEMonth & "/1/" & JEYear</SPAN>
JEDate = DateSerial(Year(dtmDate), _</SPAN>
Month(dtmDate) + 1, 0)</SPAN>
UserForm1.JD.Value = JEDate</SPAN>
UserForm1.Show</SPAN>
End Sub
& to see if i understand what I am seeing...first to lines declare variable. 2nd 2 lines are saying the variables are the MGR Data sheet w/ in the workbook, from A1 go down 2 cells & Over 2 cells & return that value (which is 7000-01)
And any code after this is a mystery to me at this point...Thanks</SPAN>