LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
HFB HFB is offline
external usenet poster
 
Posts: 17
Default Elseif code

I have:
3 combo boxes for specifying jamb profile
1 text box for specifying alternative jamb profile
1 text box for entering the width of the stud
1 text box for displaying the width of the jamb

I need the Jamb Width text box to display a value based on what is in the
jamb profile boxes and the stud box. Only one of the boxes will display a
jamb profile (e.g. if one combo box is displaying "18mm Flat" then all the
others will be "")

Basically

If Jamb Profile = "18mm Flat", "Flat", "Arch" or "Architrave", then
Jamb Width = Stud Width +22

Else Jamb Width = Stud Width + 45

I've go the following code:
'DEFINE VARIABLES
Dim Jamb As Integer
Dim Stud As Integer
Dim comFPine As String
Dim ComCPine As String
Dim ComMUF As String
Dim txtProfileSpec As String

'INPUT

Stud = Val(txtStud1)

'PROCESS
'If Profile is Architrave, then Jamb = Stud + 22
'If Profile is Grooved, then Jamb = Stud + 45

If comFPine = "18mm Flat" Then
Jamb = Stud + 22
ElseIf ComCPine = "18mm Flat" Then
Jamb = Stud + 22
ElseIf ComMUF = "18mm Flat" Then
Jamb = Stud + 22
ElseIf txtProfileSpec = "Flat" Then
Jamb = Stud + 22
ElseIf txtProfileSpec = "Architrave" Then
Jamb = Stud + 22
ElseIf txtProfileSpec = "Arch" Then
Jamb = Stud + 22

Else: Jamb = Stud + 45
End If


'OUTPUT
txtJamb1 = Str(Jamb)

At the moment, all that does is the "Stud Width + 45" Part :)


 
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
ELSEIF Loop to End Robbie Doo Excel Discussion (Misc queries) 0 January 13th 10 11:11 PM
Elseif? ibrokit Excel Worksheet Functions 5 November 25th 08 04:28 PM
if elseif flow23 Excel Discussion (Misc queries) 0 November 14th 05 02:09 PM
ElseIf tom1646 Excel Programming 4 October 19th 04 02:09 PM
If...Elseif...End If javab98 Excel Programming 2 July 19th 04 07:23 PM


All times are GMT +1. The time now is 08:34 AM.

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"