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: 21
Default shortening a macro

Anyone who can help me write the macro below a little shorter.
MVH Aksel

Private Sub ComboBox1_Change()
Application.ScreenUpdating = False
Sheets("Sheet1").Unprotect
If ComboBox1.Value = "NONE" Then
With Me.Range("K8")
.FormulaR1C1 = ""
With Me.Range("M8")
.FormulaR1C1 = ""
End With
End With
Else
If ComboBox1.Value = "2 7/8'" Then
With Me.Range("K8")
.FormulaR1C1 = "0,0145"
With Me.Range("M8")
.FormulaR1C1 = "0,0123"
End With
End With
Else
If ComboBox1.Value = "4'" Then
With Me.Range("K8")
.FormulaR1C1 = "0,0348"
With Me.Range("M8")
.FormulaR1C1 = "0,0177"
End With
End With
Else
If ComboBox1.Value = "5 7/8'" Then
With Me.Range("K8")
.FormulaR1C1 = "0,0839"
With Me.Range("M8")
.FormulaR1C1 = "0,0298"
End With
End With
Else
If ComboBox1.Value = "4'HW" Then
With Me.Range("K8")
.FormulaR1C1 = "0,0209"
With Me.Range("M8")
.FormulaR1C1 = "0,0333"
End With
End With
Else
If ComboBox1.Value = "5 7/8'HW" Then
With Me.Range("K8")
.FormulaR1C1 = "0,051"
With Me.Range("M8")
.FormulaR1C1 = "0,0686"
End With
End With
Else
If ComboBox1.Value = "DC" Then
With Me.Range("K8")
.FormulaR1C1 = ""
With Me.Range("M8")
.FormulaR1C1 = ""
End With
End With
Else
If ComboBox1.Value = "6 3/4'DC" Then
With Me.Range("K8")
.FormulaR1C1 = "0,0252"
With Me.Range("M8")
.FormulaR1C1 = "0,0948"
End With
End With
Else
If ComboBox1.Value = "8'DC" Then
With Me.Range("K8")
.FormulaR1C1 = ""
With Me.Range("M8")
.FormulaR1C1 = ""
End With
End With
Else
If ComboBox1.Value = "8 1/4'DC" Then
With Me.Range("K8")
.FormulaR1C1 = "0,0287"
With Me.Range("M8")
.FormulaR1C1 = "0,1596"
End With
End With
Else
If ComboBox1.Value = "8 3/4'DC" Then
With Me.Range("K8")
.FormulaR1C1 = ""
With Me.Range("M8")
.FormulaR1C1 = ""
End With
End With
Else
If ComboBox1.Value = "9 3/4'DC" Then
With Me.Range("K8")
.FormulaR1C1 = "0,2456"
With Me.Range("M8")
.FormulaR1C1 = "0,2743"
End With
End With
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
With Me.Range("J24")

End With
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub


 
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
Shortening a list expect_ed Excel Discussion (Misc queries) 6 April 7th 09 10:31 PM
Shortening a formula GTVT06 Excel Worksheet Functions 1 July 19th 06 11:21 PM
Shortening a formula GTVT06 Excel Discussion (Misc queries) 0 July 19th 06 05:41 PM
Shortening a vlookup T De Villiers Excel Worksheet Functions 9 January 27th 06 05:47 PM
shortening a forumula Mike_sharp Excel Discussion (Misc queries) 4 May 4th 05 04:54 PM


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