Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default last piece of the puzzle...controlsource in textbox

I have run into a problem. I have a userform which has several textboxes which currently display figures from a worksheet cell with a formula in it. Unfortunately, the formula is automatically replaced by the value in the textbox which defeats the purpose. What I want to do is have the textbox display a value based on a formula which references the active workbook.

I am a newbie so detailed code is appreciated. Additionally, I have 3 years worth of textboxes with 36 rows in each year. If there is anyway to do one set of code for each year as opposed to code for each textbox that would be helpfu

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default last piece of the puzzle...controlsource in textbox

Here is a method by John Walkenbach for handling multiple forms controls of
the same type with a single macro.

http://j-walk.com/ss/excel/tips/tip44.htm
Handle Multiple UserForm Buttons With One Subroutine

unfortunately, this doesn't work with events provided by the controls object
such as the exit and enter events.

It only works with native events like click and change.

You can't have a formula in a control source linked cell. As you have
noted, the update of the textbox wipes out the formula.

You need to update the textbox or the cell with an event.

Code is usually built to support some functionality. You haven't described
anything specific.

--
Regards,
Tom Ogilvy



"bruce forster" wrote in message
...
I have run into a problem. I have a userform which has several textboxes

which currently display figures from a worksheet cell with a formula in it.
Unfortunately, the formula is automatically replaced by the value in the
textbox which defeats the purpose. What I want to do is have the textbox
display a value based on a formula which references the active workbook.

I am a newbie so detailed code is appreciated. Additionally, I have 3

years worth of textboxes with 36 rows in each year. If there is anyway to
do one set of code for each year as opposed to code for each textbox that
would be helpful

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default last piece of the puzzle...controlsource in textbox

Withy 3 years of data, 36 textboxes per year, wouldn't it be more
appropriate to use standard worksheet functionality rather than a userform.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"bruce forster" wrote in message
...
I have run into a problem. I have a userform which has several textboxes

which currently display figures from a worksheet cell with a formula in it.
Unfortunately, the formula is automatically replaced by the value in the
textbox which defeats the purpose. What I want to do is have the textbox
display a value based on a formula which references the active workbook.

I am a newbie so detailed code is appreciated. Additionally, I have 3

years worth of textboxes with 36 rows in each year. If there is anyway to
do one set of code for each year as opposed to code for each textbox that
would be helpful

Thanks.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change UserForm ControlSource with VBA [email protected] Excel Discussion (Misc queries) 2 February 24th 05 08:05 AM
Problem with TextBox & ControlSource - Please Help [email protected] Excel Programming 8 January 14th 04 06:45 AM
Controlsource David Coleman Excel Programming 5 December 28th 03 01:14 PM
ControlSource Compatibility VBA - VB6 John M[_4_] Excel Programming 2 October 19th 03 05:30 PM
ControlSource problem Christy[_2_] Excel Programming 1 August 28th 03 03:44 AM


All times are GMT +1. The time now is 03:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"