VBA Coding?

Copper Contributor

GarryZ_0-1592801810916.png

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 from someone on the internet.  I modified it to suit, but it comes up with Error 1004.  And when I hit debug it highlights the following row - 

.Cells(iRow,1).Value=Me.txtDate.Value

I am not sure what to do?

 

Thanks

 

1 Reply
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.