PDA

View Full Version : txtboxes and cells. Updating editing userform



benjansen
06-25-2008, 03:33 AM
Hello all,

Hope you can help me....I want to do the following thing.
I have 1 userform with 10 textboxes each labeled txtBox"name".
I have 3 buttons, 1 x update fields and 1 x change fields and close form.

step 1
So when I open this excel sheet it opens the form when i fill in the textboxes and click on update. the first sheet called "details" is used to transport the values that were filled in towards the cells in collumn B.
I should close the form with "close form" and then save the spreadsheet.

step 2
When I open the same sheet afterwords i want to be able to change the values that were entered in step 1. and then click update or the change button.

I have tried some codes that I found online. but none were to my satisfaction......

You would be a great help if you could help me with this one.

Greetings,


Ben
PS: hope to hear from you soon.

lucas
06-25-2008, 08:14 AM
Hi Ben,
Since you have just posted an example of your userform with basically no code I am going to post a simple example that will give you some clues and probably give rise to some questions.....see if it helps you and as I said if you have questions post back here.

benjansen
06-26-2008, 11:17 PM
Hey Lucas,

Thanx for you reply. Seems that something is wrong with your included file. It hangs on

Private Sub cmdOK_Click()
ActiveWorkbook.Sheets("List").Activate

I didn't enter any code in my original file.....please help solving the error.

Ben

lucas
06-27-2008, 07:22 AM
Hi Ben, I tried every way I could think of to get it to reproduce the error you mention. Can you tell me exactly what you are doing when it occurs.

Is it happening in the workbook I have in post #2 or are you copying it to another workbook and trying it?

lucas
06-27-2008, 07:24 AM
If you are putting it in a different file and you don't have a sheet named "list" then that would cause the problem.

Please also tell me what the error says.

benjansen
07-01-2008, 03:11 AM
hey all..

Found a partial solution. It is not a beauti....but here goes:

OnLoad of the document or macrobutton
"FORM"."TEXTBOX".Value = Worksheets("SHEETNAME").Range("CELL")

Button in form, UpdateAllFields in Excel cells
Worksheets("SHEETNAME").Range("CELL") = "FORM"."TEXTBOX".Value

The upper solutions handles textboxes with no problem. Only listboxes and comboboxes do not work.

If anyone knows????I inserted a prep file