![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Apr 2002
Posts: 758
|
I have created a user form and want the form to display the data from specific cells when it is opened and then write it back to the relevant cell when OK is clicked.
Can anyone help It was a doddle in quatro pro but I can't achieve it in Excel |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Location: Where the wild roses grow
Posts: 285
|
So do you mean that when the form loads up, the various boxes display the values in certain cells on the worksheet?
If so, put this in your Userform Initialize event: Textbox1.value=worksheets("sheet1").range("a1") This puts the value in cell A1 of Sheet1 into Textbox 1 when the form initializes. You can copy and customixe this for the rest of your boxes Audiojoe |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Apr 2002
Posts: 758
|
Thanks
Will that then write out an amended value when the form closes |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Feb 2002
Location: Where the wild roses grow
Posts: 285
|
Further to this, to display a changed value back into the cell put this into your Textbox's Change Event:
Worksheets("sheet1").range("a1").value= Textbox1 This will update the cell as you write it Audiojoe |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Apr 2002
Posts: 758
|
Cheers Audiojoe I'll put it to the test tonight
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|