![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Location: Baltimore
Posts: 29
|
Isn't there a way I can do this code with a select case statement?
If OPTPan.Value = True Then Sheets("Order Table").Range("C" & intcurrentrow).Value = "Personal" Sheets("Order Table").Range("D" & intcurrentrow).Value = 4.99 + 0.5 * bytToppings End If If OPT10inch.Value = True Then Sheets("Order Table").Range("C" & intcurrentrow).Value = "10 inch" Sheets("Order Table").Range("D" & intcurrentrow).Value = 5.99 + 0.5 * bytToppings End If If OPT12inch.Value = True Then Sheets("Order Table").Range("C" & intcurrentrow).Value = "12 inch" Sheets("Order Table").Range("D" & intcurrentrow).Value = 7.99 + 0.5 * bytToppings End If If OPT14inch.Value = True Then Sheets("Order Table").Range("C" & intcurrentrow).Value = "14 inch" Sheets("Order Table").Range("D" & intcurrentrow).Value = 9.99 + 0.5 * bytToppings End If If OPT16inch.Value = True Then Sheets("Order Table").Range("C" & intcurrentrow).Value = "16 inch" Sheets("Order Table").Range("D" & intcurrentrow).Value = 10.99 + 0.5 * bytToppings End If If OPTSicilian.Value = True Then Sheets("Order Table").Range("C" & intcurrentrow).Value = "Sicilian" Sheets("Order Table").Range("D" & intcurrentrow).Value = 11.5 + 0.5 * bytToppings End If |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
|
Change from Option buttons to a dropdown list that the user selects one length.
The length is then assigned to a variable ie VarLength. Now you can do a: Select case Varlen Case 10in case 12in case etc etc |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|