Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default Showing a calculation in a userform Textbox

Roedd wedi ysgrifennu:

Ok...

I am trying to make a text box (aptly named txtCalc) to show a
calculation between another txt box (txtAmount) and a cell that exists
in the spreadsheet behind the form. The calculation will show a bank
balance preview.

For example the cell that is mentioned above is Cell F1 and contains a
figure of £9000

In the userform, the user enters a transaction of - £500 in txtAmount
field. thus the txtCalc area automatically shows a figure of £8500.
This figure does not have to go onto the spreadsheet (but can if
needed).


Are you saying that the user will input /literally/ the string "- £500" in
the textbox, operator and all?

It would make this a whole lot easier if you could get them to leave the
currency symbol out. Presumably the currency symbol on the value in the
worksheet is only there as a result of formatting?

Then you could use something like:

txtCalc.value = Application.Evaluate(cstr(range("F1")) & txtAmount.Value)

....though you're going to have to include a fair amount of validation and
error trapping.

--
Rob


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
Calculated Textbox not showing proper results. zootieb Excel Discussion (Misc queries) 4 May 20th 07 11:14 AM
TextBox calculation johncassell[_2_] Excel Programming 0 July 7th 05 11:50 PM
Textbox calculation No Name Excel Programming 2 October 6th 04 01:59 PM
Date Calculation in UserForm TextBox John Pierce Excel Programming 2 February 28th 04 12:11 AM
UserForm TextBox to ActiveSheet TextBox over 256 characters Dan E[_2_] Excel Programming 1 July 28th 03 07:36 PM


All times are GMT +1. The time now is 07:51 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"