Hello,

I'm having an issue trying to use variables in the .range function in vba. Below is the line I have in my code. I keep getting an error saying "Sub or Function not defined" and it highlights "Cells".

xlSheet.Range(Cells(lngLast + 1, dateRow), Cells(lngLast + rowCount - 1, dateRow)).Value = xlTempSheet.Range("Q5", "Q" & lngTempLast - 3).Value

Any suggestions?

Thanks