LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 116
Default Easy One - do math with Textbox values

Hello:

I'm trying to do some simple math using the values in some textboxes, and
I'm getting an error on this statement:

Controls("TextBox" & (Y + 2)).Value = Round((Controls("TextBox" & _
(Y + 1)).Value / 100 * WORSTKG), 0)

The right side of the equation takes a value from a textbox, divides it by
100, multiples it by another variable (WORSTKG - which is a numeric value
from another textbox) and then rounds it off to a whole number and puts the
answer into a third textbox. It's part of a loop which is why the textbox
name contains a variable suffix.

At least that's the plan, but I'm getting a "type mismatch" error.

LATE NOTE: should it make a difference if I set the Controls("TextBox" & (Y
+ 1)).Value expression equal to a variable before doing the math (the way I
did WORSTKG?)? If so, why would it?

Help would be appreciated.

Thanks,
MARTY
 
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
Easy One - Syntax for variables in TextBox & Label names Marty Excel Programming 5 December 19th 07 05:24 PM
How do I add TextBox.values? WTG Excel Discussion (Misc queries) 1 February 27th 05 08:25 PM
How do I add TextBox.values? WTG Excel Worksheet Functions 1 February 27th 05 08:22 PM
Clearing Form Values the easy Way??? [email protected] Excel Programming 5 January 15th 05 07:31 AM
easy question : textbox Yan Robidoux Excel Programming 6 August 9th 04 01:05 PM


All times are GMT +1. The time now is 11:53 PM.

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"