Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tony,
You could either restore the formula in the ControlSource programmatically when your code makes changes to cells the formula refs, OR use the Worksheet_Change event to update the appropriate textbox (no ControlSource set). Of course, you'd need a mechanism to test if the userform is open but that's no problem... If Not fMyForm Is Nothing Then _ fMyForm.txtMyTextbox.Text = Target.Value ...assumes you also checked to verify that 'Target' is the cell with the formula linked to your textbox. From a maintenance standpoint, I'd go with restoring the formula... sMyLinkedCellFormula = Range("MyLinkedCell").Formula '..make changes Range("MyLinkedCell").Formula = sMyLinkedCellFormula ...where your procedure that changes ref'd cells can load the existing formula into the variable BEFORE making changes, then put it back afterward. I recommend using defined names for the cells, scoped local to the worksheet so there's no ambiguity as to which cells your code works with when your sheet layout gets revised, or when rows/cols are inserted/deleted. -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Userform and textboxes | Excel Programming | |||
UserForm TextBoxes | Excel Discussion (Misc queries) | |||
userform & textboxes | Excel Programming | |||
userform textboxes again | Excel Programming | |||
userform textboxes | Excel Programming |