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: 6
Default 2 Textbox questions

1. Textbox Number Format

Based on a combobox selection a textbox is filled as shown below:

Private Sub cmbAWS_Change()
Set rng = Range(cmbAWS.RowSource)
txtSFA.Text = rng(cmbAWS.ListIndex + 1)(1, 2)
End sub

The value that is supposed to be read in to the textbox from the
worksheet is sometimes a single decimal (5.1) or a two decimal
(5.10)number depending on the combobox selection, but the value
displayed is always a single decimal(5.1).

How can I get the textbox to display what is shown on the worksheet
(5.1 or 5.10)?

2. Deleting Value from Textbox

The user is to enter a value and based on the value entered in the
textbox txtDefectLength, it will use a dimension which had been
previously entered into the worksheet(rng3) to calculate percent of of
defect.

Private Sub txtDefectLength_Change()
Dim rng1 As Range
Set rng1 = Worksheets("WPQ").Range("CD24")
txtPrecentDefect.Value = (((txtDefectLength.Value) / (rng3 / 4))
* 100)
If txtPrecentDefect.Text <= 10 Then
txtResults.Value = "Passed"
Else: txtResults.Value = "Failes"
End If
End Sub

When entering a value into the textbox(txtDefectLength) it works fine,
but if the text is deleted to enter a different value I become the
error message "Type mismatch (Error 13)"

What can I do to stop this from happening?

Any help would be appreciated.

Kind Regards
Martin
 
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
Answers to questions posing more questions in a workbook sbelle1 Excel Worksheet Functions 2 August 8th 09 01:02 AM
Calculate Textbox value based on another textbox value.doc Tdungate Excel Discussion (Misc queries) 1 February 12th 09 07:11 PM
Calculate Textbox value based on another textbox value Tdungate Excel Discussion (Misc queries) 0 February 12th 09 07:03 PM
View Questions and Answer to questions I created Roibn Taylor Excel Discussion (Misc queries) 4 July 24th 08 12:05 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 03:48 PM.

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

About Us

"It's about Microsoft Excel"