C
chadtastic
I need a little help in coding a, "Save" button on a VBA form.
I have about 5 text boxes. The user enters data in each text box and,
as of right now, the data automatically gets saved as I am using the
_change event. (TextBox1_Change()) This stores the value of each text
box into a cell of my choosing on an Excel spreadsheet automatically.
From what I gather, it would be better, as a coder, to use the _Enter
event. (TextBox1_Enter.) This way, when the user fills out the
information in the text boxes, the information will NOT be loaded onto
an Excel spreadsheet automatically as they type. (Which is what it
does now by using the following code for each text box
)Private Sub TextBox1_Change()
Sheets("Sheet1").Range("A" & intRow.) = TextBox1.Value
Instead, I want it to only be stored to the spreadsheet once they hit
a, "Save" button.
My question is this - simply put, how do I code the save button so that
it stores all the information on all five text boxes?
Also, note that the value of each text box gets stored in the next
available (or empty) row in rows, "A", "b", "C", "D", and, "E."
So the first time a user fills out a form, the values will go into
cells, "A1", then in, "B1", then in, "C1", ect..........
The next time the user enters values in the text boxes (say if the form
is cleared or the program is ran again), the value will be stored in,
"A2", then in, "B2", then, "C2", ect....... (I think you get the
picture.)
When coding this, "Save" button, I want to make sure that if the user
happens to NOT fill out a text box (which is allowable) when filling
out a form that the next time they go to use the program and fill in
the form, all values of all five text boxes are saved in that row.
I have noticed that if the user DOES choose to fill in the text box
that they skipped last time, that the value goes to the previous
skpped instead of going to the CURRENT row. I hope I explained this
enough for someone to understand cause I'm LOST with the coding of
this.
Please Help?!?!
I have about 5 text boxes. The user enters data in each text box and,
as of right now, the data automatically gets saved as I am using the
_change event. (TextBox1_Change()) This stores the value of each text
box into a cell of my choosing on an Excel spreadsheet automatically.
From what I gather, it would be better, as a coder, to use the _Enter
event. (TextBox1_Enter.) This way, when the user fills out the
information in the text boxes, the information will NOT be loaded onto
an Excel spreadsheet automatically as they type. (Which is what it
does now by using the following code for each text box
)Private Sub TextBox1_Change()
Sheets("Sheet1").Range("A" & intRow.) = TextBox1.Value
Instead, I want it to only be stored to the spreadsheet once they hit
a, "Save" button.
My question is this - simply put, how do I code the save button so that
it stores all the information on all five text boxes?
Also, note that the value of each text box gets stored in the next
available (or empty) row in rows, "A", "b", "C", "D", and, "E."
So the first time a user fills out a form, the values will go into
cells, "A1", then in, "B1", then in, "C1", ect..........
The next time the user enters values in the text boxes (say if the form
is cleared or the program is ran again), the value will be stored in,
"A2", then in, "B2", then, "C2", ect....... (I think you get the
picture.)
When coding this, "Save" button, I want to make sure that if the user
happens to NOT fill out a text box (which is allowable) when filling
out a form that the next time they go to use the program and fill in
the form, all values of all five text boxes are saved in that row.
I have noticed that if the user DOES choose to fill in the text box
that they skipped last time, that the value goes to the previous
skpped instead of going to the CURRENT row. I hope I explained this
enough for someone to understand cause I'm LOST with the coding of
this.
Please Help?!?!