VBA Coding?

%3CLINGO-SUB%20id%3D%22lingo-sub-1480005%22%20slang%3D%22en-US%22%3EVBA%20Coding%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1480005%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22GarryZ_0-1592801810916.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F199968i4E6516951EBC2FC5%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22GarryZ_0-1592801810916.png%22%20alt%3D%22GarryZ_0-1592801810916.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EHI%20to%20All%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20create%20a%20data%20entry%20user%20form%20for%20an%20excel%20spreadsheet%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20use%20VBA%20to%20code%20with%20no%20code%20experience.%26nbsp%3B%20I%20copied%20and%20pasted%20some%20code%20from%20a%20similar%20example%20from%20someone%20on%20the%20internet.%26nbsp%3B%20I%20modified%20it%20to%20suit%2C%20but%20it%20comes%20up%20with%20Error%201004.%26nbsp%3B%20And%20when%20I%20hit%20debug%20it%20highlights%20the%20following%20row%20-%26nbsp%3B%3C%2FP%3E%3CP%3E.Cells(iRow%2C1).Value%3DMe.txtDate.Value%3C%2FP%3E%3CP%3EI%20am%20not%20sure%20what%20to%20do%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1480005%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Occasional Visitor

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
Highlighted
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.