Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Value is not displayed on the screen

When I do this coding in VBA:
================================================== =======
If txtDmdPeak.Text <= txtDtotal.Text Then
'Firm - Normal Bill
If Answer = True Then
If txtCalculatedDemand.Text < txtDsbf.Text Then
txtFirmStandbyCharge.Text = (txtDsbf.Value -
txtCalculatedDemand.Value) * txtMaxDmcFirm.Value
If txtFirmStandbyCharge.Value = "" Then
txtFirmStandbyCharge.Value = "0"
Else
txtFirmStandbyCharge.Value = Format
(txtFirmStandbyCharge.Value, "######.##")
End If
End If

If txtDsbf.Text < txtCalculatedDemand.Text Then
If txtCalculatedDemand.Text < txtDtotal.Text Then
txtFirmStandbyCharge.Text = (txtDtotal.Value -
txtCalculatedDemand.Value) * txtMaxDmcNonFirm.Value
If txtFirmStandbyCharge.Text = "" Then
txtFirmStandbyCharge.Text = "0"
Else
txtFirmStandbyCharge.Value = Format
(txtFirmStandbyCharge.Value, "######.##")
End If
End If
End If
================================================== ======

It does not display the results on the screen for this
particular textbox. Is there anything wrong with the
properties which I set?

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Value is not displayed on the screen

It may be that your text does not display if the
conditions don't satisfy your conditions. I see at least
TWO missing ELSE staements where you would miss putting
in values. Take a look at the following - I made one
small adjustment, and included the two missing else's -
you can fill the missing code...

If txtDmdPeak.Text <= txtDtotal.Text Then
'Firm - Normal Bill
If Answer = True Then
If txtCalculatedDemand.Text < txtDsbf.Text Then
txtFirmStandbyCharge.Text = (txtDsbf.Value -
txtCalculatedDemand.Value) * txtMaxDmcFirm.Value
If txtFirmStandbyCharge.Value = "" Then
txtFirmStandbyCharge.Value = "0"
Else
txtFirmStandbyCharge.Value = Format
(txtFirmStandbyCharge.Value, "######.##")
End If

Else ' I changed from your code
' why use IF here??
If txtCalculatedDemand.Text < txtDtotal.Text Then _
txtFirmStandbyCharge.Text = (txtDtotal.Value -
txtCalculatedDemand.Value) * txtMaxDmcNonFirm.Value
If txtFirmStandbyCharge.Text = "" Then
txtFirmStandbyCharge.Text = "0"
Else
txtFirmStandbyCharge.Value = Format
(txtFirmStandbyCharge.Value, "######.##")
End If
Else

'????

End If

End If
Else
'????? Not normal bill

End If


Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
When I do this coding in VBA:
================================================= ========
If txtDmdPeak.Text <= txtDtotal.Text Then
'Firm - Normal Bill
If Answer = True Then
If txtCalculatedDemand.Text < txtDsbf.Text Then
txtFirmStandbyCharge.Text = (txtDsbf.Value -
txtCalculatedDemand.Value) * txtMaxDmcFirm.Value
If txtFirmStandbyCharge.Value = "" Then
txtFirmStandbyCharge.Value = "0"
Else
txtFirmStandbyCharge.Value = Format
(txtFirmStandbyCharge.Value, "######.##")
End If
End If

If txtDsbf.Text < txtCalculatedDemand.Text Then
If txtCalculatedDemand.Text < txtDtotal.Text Then
txtFirmStandbyCharge.Text =

(txtDtotal.Value -
txtCalculatedDemand.Value) * txtMaxDmcNonFirm.Value
If txtFirmStandbyCharge.Text = "" Then
txtFirmStandbyCharge.Text = "0"
Else
txtFirmStandbyCharge.Value = Format
(txtFirmStandbyCharge.Value, "######.##")
End If
End If
End If
================================================= =======

It does not display the results on the screen for this
particular textbox. Is there anything wrong with the
properties which I set?

Thanks.
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Value is not displayed on the screen

Hello,

That was quite helpful but I have a question here. What
is max condition can u have in an If...Else Statement. I
have four conditions. How do I apply the if...else
statement on this conditions?

As what I know and have tried, in an if..else statement,
we can only have one "else if" and one "else" within the
structure. I hope I'm not being confusing.

Thanks.

Sheela


-----Original Message-----
It may be that your text does not display if the
conditions don't satisfy your conditions. I see at least
TWO missing ELSE staements where you would miss putting
in values. Take a look at the following - I made one
small adjustment, and included the two missing else's -
you can fill the missing code...

If txtDmdPeak.Text <= txtDtotal.Text Then
'Firm - Normal Bill
If Answer = True Then
If txtCalculatedDemand.Text < txtDsbf.Text Then
txtFirmStandbyCharge.Text = (txtDsbf.Value -
txtCalculatedDemand.Value) * txtMaxDmcFirm.Value
If txtFirmStandbyCharge.Value = "" Then
txtFirmStandbyCharge.Value = "0"
Else
txtFirmStandbyCharge.Value = Format
(txtFirmStandbyCharge.Value, "######.##")
End If

Else ' I changed from your code
' why use IF here??
If txtCalculatedDemand.Text < txtDtotal.Text Then

_
txtFirmStandbyCharge.Text =

(txtDtotal.Value -
txtCalculatedDemand.Value) * txtMaxDmcNonFirm.Value
If txtFirmStandbyCharge.Text = "" Then
txtFirmStandbyCharge.Text = "0"
Else
txtFirmStandbyCharge.Value = Format
(txtFirmStandbyCharge.Value, "######.##")
End If
Else

'????

End If

End If
Else
'????? Not normal bill

End If


Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
When I do this coding in VBA:
================================================ ========

=
If txtDmdPeak.Text <= txtDtotal.Text Then
'Firm - Normal Bill
If Answer = True Then
If txtCalculatedDemand.Text < txtDsbf.Text Then
txtFirmStandbyCharge.Text = (txtDsbf.Value -
txtCalculatedDemand.Value) * txtMaxDmcFirm.Value
If txtFirmStandbyCharge.Value = "" Then
txtFirmStandbyCharge.Value = "0"
Else
txtFirmStandbyCharge.Value = Format
(txtFirmStandbyCharge.Value, "######.##")
End If
End If

If txtDsbf.Text < txtCalculatedDemand.Text Then
If txtCalculatedDemand.Text < txtDtotal.Text

Then
txtFirmStandbyCharge.Text =

(txtDtotal.Value -
txtCalculatedDemand.Value) * txtMaxDmcNonFirm.Value
If txtFirmStandbyCharge.Text = "" Then
txtFirmStandbyCharge.Text = "0"
Else
txtFirmStandbyCharge.Value = Format
(txtFirmStandbyCharge.Value, "######.##")
End If
End If
End If
================================================ ========

It does not display the results on the screen for this
particular textbox. Is there anything wrong with the
properties which I set?

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
my excel sheet is not displayed but black screen appears amjadaali Excel Discussion (Misc queries) 2 November 25th 08 06:01 PM
Setting hyperlinked cells to be displayed at the top of the screen taliqmassaman Excel Discussion (Misc queries) 0 August 4th 06 05:10 PM
print box opens in right screen of dual screen setup why gerrys Excel Discussion (Misc queries) 1 June 30th 06 06:47 PM
Why do cells in Excel print shorter than displayed on-screen? Mary Madeline Excel Discussion (Misc queries) 0 October 21st 05 07:46 PM
Amount of Data in a Cell Displayed On Screen/Print James H Excel Discussion (Misc queries) 3 April 27th 05 06:47 PM


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