Command Button OK VBA Excel
Feng
-
Clark...kent Posted messages 50 Status Member -
Clark...kent Posted messages 50 Status Member -
Hello,
I am currently programming my OK button command. In my userform window, I have created several text boxes for the user to input data.
I want to be able to retrieve this data and put it into my function variables (Actually, this data is used to fill in the rows of my Excel sheet)....
Since I do not really know VBA very well.... in terms of syntax, I really don't know how to do it, and I can't seem to find any examples of this type of code.
Could someone please help me??
Thank you very much for your help!
Configuration: Windows XP / Firefox 10.0.4
I am currently programming my OK button command. In my userform window, I have created several text boxes for the user to input data.
I want to be able to retrieve this data and put it into my function variables (Actually, this data is used to fill in the rows of my Excel sheet)....
Since I do not really know VBA very well.... in terms of syntax, I really don't know how to do it, and I can't seem to find any examples of this type of code.
Could someone please help me??
Thank you very much for your help!
Configuration: Windows XP / Firefox 10.0.4
And the code I wrote is:
'The position in the Excel sheet to fill
Position = Worksheets("Control System I O list").Range("P1").End(xlUp).Row
'Storing the value from the text box
Worksheets("Control System I O list").Range("P" & Position).Value = _
frm_ADRESSE.CompanyProjectNumber.Value
'Clearing the text box
frm_ADRESSE.CompanyProjectNumber.Value = ""
The "CompanyProjectNumber" is the name of my textbox.
But it doesn't work, it gives me an "object required" error on
Worksheets("Control System I O list").Range("P" & Position).Value = _
frm_ADRESSE.CompanyProjectNumber.Value
And I don't see where the error is....