Forum Discussion
GarryZ
Jun 21, 2020Copper Contributor
VBA Coding?
HI to All I am trying to create a data entry user form for an excel spreadsheet I am trying to use VBA to code with no code experience. I copied and pasted some code from a similar example f...
Zack Barresse
Jun 24, 2020Iron Contributor
Hello there,
Without knowing more, my guess is the iRow variable puts the Range to something illegal or unrecognized. What is the value of iRow at run-time when the error is produced? Hit 'Debug', then hover your mouse over the variable. If it doesn't show up, hit CTRL+I (sound: eye, not ell). Also, what is the value of 'txtDate' control at run-time?
Additionally, it appears you're working with a Table. Is the data supposed to go there? If so, you should probably use the code for it instead of the standard Cells/Range objects.
Without knowing more, my guess is the iRow variable puts the Range to something illegal or unrecognized. What is the value of iRow at run-time when the error is produced? Hit 'Debug', then hover your mouse over the variable. If it doesn't show up, hit CTRL+I (sound: eye, not ell). Also, what is the value of 'txtDate' control at run-time?
Additionally, it appears you're working with a Table. Is the data supposed to go there? If so, you should probably use the code for it instead of the standard Cells/Range objects.