Sei sulla pagina 1di 6

Attribute VB_Name = "Module1" Sub Beam() Attribute Beam.

VB_Description = "Beam Design and calculates total quantity of re inforcement from ETABS file" Attribute Beam.VB_ProcData.VB_Invoke_Func = " \n14" ' ' Beam Macro for ETABS v9.5 & V9.6 ' Beam Design and calculates total quantity of reinforcement from ETABS file ' Use Unit kN-m only ' Created By Atul Tegar atul.tegar@gmail.com ' Range("A1").Select With ActiveWindow .SplitColumn = 0 .SplitRow = 1 End With ActiveWindow.FreezePanes = True Dim Str As Double On Error Resume Next Application.DisplayAlerts = False Str = Application.InputBox(Prompt:="Enter Stirrup Length in meters", Tit le:="Stirrup Length") On Error GoTo 0 Application.DisplayAlerts = True Selection.Subtotal GroupBy:=1, Function:=xlCount, TotalList:=Array(17), _ Replace:=True, PageBreaks:=False, SummaryBelowData:=True Selection.Subtotal GroupBy:=2, Function:=xlAverage, TotalList:=Array(4, 8, _ 11, 13, 15), Replace:=True, PageBreaks:=False, SummaryBelowData:=True ActiveSheet.Outline.ShowLevels RowLevels:=2 Range("R1").Select ActiveCell.FormulaR1C1 = "Top Rebar" Range("S1").Select ActiveCell.FormulaR1C1 = "Bottom Rebar" Range("T1").Select ActiveCell.FormulaR1C1 = "Shear Rebar" Range("U1").Select ActiveCell.FormulaR1C1 = "Torsion Rebar" Range("R2").Select ActiveCell.FormulaR1C1 = "=RC[-14]*RC[-10]*2" Range("S2").Select ActiveCell.FormulaR1C1 = "=RC[-15]*RC[-8]*2" Range("T2").Select ActiveCell.FormulaR1C1 = "=RC[-16]*RC[-7]*2*" & Str Range("U2").Select ActiveCell.FormulaR1C1 = "=RC[-17]*RC[-6]*2*" & Str Dim y As Long y = Range("B" & Rows.Count).End(xlUp).Row Range("R2").AutoFill Destination:=Range("R2:R" & y), Type:=xlFillDefault Range("S2").AutoFill Destination:=Range("S2:S" & y), Type:=xlFillDefault Range("T2").AutoFill Destination:=Range("T2:T" & y), Type:=xlFillDefault Range("U2").AutoFill Destination:=Range("U2:U" & y), Type:=xlFillDefault Dim x, x1, x2, x3 As Long x = y + 1 x1 = y + 2 x2 = y + 3 x3 = y + 4 Range("P" & x).Select ActiveCell.FormulaR1C1 = "Steel in cu.m." Range("P" & x1).Select

ActiveCell.FormulaR1C1 = "Steel in kg" Range("P" & x2).Select ActiveCell.FormulaR1C1 = "Steel in MT" Range("R" & x).Select ActiveCell.FormulaR1C1 = Application.SumIf(Range("B2:B" Range("R2:R" & y)) Range("S" & x).Select ActiveCell.FormulaR1C1 = Application.SumIf(Range("B2:B" Range("S2:S" & y)) Range("T" & x).Select ActiveCell.FormulaR1C1 = Application.SumIf(Range("B2:B" Range("T2:T" & y)) Range("U" & x).Select ActiveCell.FormulaR1C1 = Application.SumIf(Range("B2:B" Range("U2:U" & y)) Range("R" & x1).Select ActiveCell.FormulaR1C1 = "=R[-1]C*7850" Selection.Font.Bold = True Range("S" & x1).Select ActiveCell.FormulaR1C1 = "=R[-1]C*7850" Selection.Font.Bold = True Range("T" & x1).Select ActiveCell.FormulaR1C1 = "=R[-1]C*7850" Selection.Font.Bold = True Range("U" & x1).Select ActiveCell.FormulaR1C1 = "=R[-1]C*7850" Selection.Font.Bold = True Range("R" & x2).Select ActiveCell.FormulaR1C1 = "=R[-1]C/1000" Selection.Font.Bold = True Range("S" & x2).Select ActiveCell.FormulaR1C1 = "=R[-1]C/1000" Selection.Font.Bold = True Range("T" & x2).Select ActiveCell.FormulaR1C1 = "=R[-1]C/1000" Selection.Font.Bold = True Range("U" & x2).Select ActiveCell.FormulaR1C1 = "=R[-1]C/1000" Selection.Font.Bold = True Range("P" & x3).Select ActiveCell.FormulaR1C1 = "Total Steel in MT" Range("R" & x3).Select ActiveCell.FormulaR1C1 = "=SUM(R[-1]C:R[-1]c[3])" Selection.Font.Bold = True End Sub

& y), "B* Average", & y), "B* Average", & y), "B* Average", & y), "B* Average",

Sub Column() ' ' Column Macro for ETABS v9.5 & V9.6 ' Column Design and calculates total quantity of reinforcement from ETABS file ' Use Unit kN-m only ' Created By Atul Tegar atul.tegar@gmail.com ' Range("A1").Select Dim z As Long z = Range("A" & Rows.Count).End(xlUp).Row Cells.Select ActiveSheet.Sort.SortFields.Clear ActiveSheet.Sort.SortFields.Add Key:=Range( _

"A2:A" & z), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _ xlSortNormal With ActiveSheet.Sort .SetRange Range("A1:R" & z) .Header = xlYes .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply End With With ActiveWindow .SplitColumn = 0 .SplitRow = 1 End With ActiveWindow.FreezePanes = True Dim Str, Depth, D2 As Double On Error Resume Next Application.DisplayAlerts = False Str = Application.InputBox(Prompt:="Enter Lateral Ties Length in meters" , Title:="Ties Length") Depth = Application.InputBox(Prompt:="Enter Max Beam Depth in meters", T itle:="Beam Depth") On Error GoTo 0 D2 = Depth / 2 Application.DisplayAlerts = True Range("S1").Select ActiveCell.FormulaR1C1 = "Location" Range("S2").Select ActiveCell.FormulaR1C1 = "=RC[-15]+" & D2 Range("S2").AutoFill Destination:=Range("S2:S" & z), Type:=xlFillDefault Range("A1").Select Selection.Subtotal GroupBy:=1, Function:=xlCount, TotalList:=Array(18), _ Replace:=True, PageBreaks:=False, SummaryBelowData:=True Selection.Subtotal GroupBy:=2, Function:=xlAverage, TotalList:=Array(9, 14, _ 16, 19), Replace:=True, PageBreaks:=False, SummaryBelowData:=True ActiveSheet.Outline.ShowLevels RowLevels:=2 Range("T1").Select ActiveCell.FormulaR1C1 = "Main Rebar" Range("U1").Select ActiveCell.FormulaR1C1 = "Shear1 Rebar" Range("V1").Select ActiveCell.FormulaR1C1 = "Shear2 Rebar" Range("T2").Select ActiveCell.FormulaR1C1 = "=RC[-1]*RC[-11]*2" Range("U2").Select ActiveCell.FormulaR1C1 = "=RC[-2]*RC[-7]*2*" & Str Range("V2").Select ActiveCell.FormulaR1C1 = "=RC[-3]*RC[-6]*2*" & Str Dim y As Long y = Range("B" & Rows.Count).End(xlUp).Row Range("T2").AutoFill Destination:=Range("T2:T" & y), Type:=xlFillDefault Range("U2").AutoFill Destination:=Range("U2:U" & y), Type:=xlFillDefault Range("V2").AutoFill Destination:=Range("V2:V" & y), Type:=xlFillDefault Dim x, x1, x2, x3 As Long x = y + 1 x1 = y + 2 x2 = y + 3 x3 = y + 4 Range("R" & x).Select

ActiveCell.FormulaR1C1 = "Steel in cu.m." Range("R" & x1).Select ActiveCell.FormulaR1C1 = "Steel in kg" Range("R" & x2).Select ActiveCell.FormulaR1C1 = "Steel in MT" Range("T" & x).Select ActiveCell.FormulaR1C1 = Application.SumIf(Range("B2:B" & y), "C* Average", Range("T2:T" & y)) Range("U" & x).Select ActiveCell.FormulaR1C1 = Application.SumIf(Range("B2:B" & y), "C* Average", Range("U2:U" & y)) Range("V" & x).Select ActiveCell.FormulaR1C1 = Application.SumIf(Range("B2:B" & y), "C* Average", Range("V2:V" & y)) Range("T" & x1).Select ActiveCell.FormulaR1C1 = "=R[-1]C*7850" Selection.Font.Bold = True Range("U" & x1).Select ActiveCell.FormulaR1C1 = "=R[-1]C*7850" Selection.Font.Bold = True Range("V" & x1).Select ActiveCell.FormulaR1C1 = "=R[-1]C*7850" Selection.Font.Bold = True Range("T" & x2).Select ActiveCell.FormulaR1C1 = "=R[-1]C/1000" Selection.Font.Bold = True Range("U" & x2).Select ActiveCell.FormulaR1C1 = "=R[-1]C/1000" Selection.Font.Bold = True Range("V" & x2).Select ActiveCell.FormulaR1C1 = "=R[-1]C/1000" Selection.Font.Bold = True Range("R" & x3).Select ActiveCell.FormulaR1C1 = "Total Steel in MT" Range("T" & x3).Select ActiveCell.FormulaR1C1 = "=SUM(R[-1]C:R[-1]C[2])" Selection.Font.Bold = True End Sub Sub Wall() ' ' Wall Macro for ETABS v9.5 & V9.6 ' Shear Wall Design and calculates total quantity of reinforcement from ETABS fi le ' Use Unit kN-m only, reinforcement in mm2/m ' Created By Atul Tegar atul.tegar@gmail.com ' Range("A1").Select Dim z, z1, z2, z3, z4, z5 As Long z = Range("C" & Rows.Count).End(xlUp).Row z1 = z + 1 z2 = z + 2 z3 = z + 3 z4 = z + 4 z5 = z + 5 With ActiveWindow .SplitColumn = 0 .SplitRow = 1 End With

ActiveWindow.FreezePanes = True Dim WD, SH, CC, CC2, N2, R2 As Double On Error Resume Next Application.DisplayAlerts = False WD = Application.InputBox(Prompt:="Enter Width of Wall in meters", Title :="Shear Wall Width") SH = Application.InputBox(Prompt:="Enter Average Storey Height in meters ", Title:="Storey Height") CC = Application.InputBox(Prompt:="Enter clear cover of wall in meters", Title:="Clear Cover") On Error GoTo 0 CC2 = CC * 2 Application.DisplayAlerts = True Range("R1").Select ActiveCell.FormulaR1C1 = "Length" Range("S1").Select ActiveCell.FormulaR1C1 = "Main Rebar" Range("T1").Select ActiveCell.FormulaR1C1 = "Shear Rebar" Range("U1").Select ActiveCell.FormulaR1C1 = "Gross Area Left" Range("V1").Select ActiveCell.FormulaR1C1 = "Gross Area Right" Range("W1").Select ActiveCell.FormulaR1C1 = "As Left" Range("X1").Select ActiveCell.FormulaR1C1 = "As Right" Range("R2").Select ActiveCell.FormulaR1C1 = "=SQRT((RC[-6]-RC[-8])^2+(RC[-5]-RC[-7])^2)" Range("S2").Select ActiveCell.FormulaR1C1 = "=RC[-11]*RC[-1]" Range("Y1").Select ActiveCell.FormulaR1C1 = "Wall Width" Range("Y2").Select ActiveCell.FormulaR1C1 = WD Range("Z1").Select ActiveCell.FormulaR1C1 = "Clear Cover" Range("Z2").Select ActiveCell.FormulaR1C1 = CC2 Range("T2").Select ActiveCell.FormulaR1C1 = "=RC[-6] * ((RC[-2] - RC[6])+(RC[5]-RC[6]))*2" Range("U2").Select ActiveCell.FormulaR1C1 = "=RC[-6]*" & WD Range("V2").Select ActiveCell.FormulaR1C1 = "=RC[-6]*" & WD Range("W2").Select ActiveCell.FormulaR1C1 = "=0.02*RC[-2]" Range("X2").Select ActiveCell.FormulaR1C1 = "=0.02*RC[-2]" Range("Y2").AutoFill Destination:=Range("Y2:Y" & z), Type:=xlFillDefault Range("Z2").AutoFill Destination:=Range("Z2:Z" & z), Type:=xlFillDefault Range("R2").AutoFill Destination:=Range("R2:R" & z), Type:=xlFillDefault Range("S2").AutoFill Destination:=Range("S2:S" & z), Type:=xlFillDefault Range("T2").AutoFill Destination:=Range("T2:T" & z), Type:=xlFillDefault Range("U2").AutoFill Destination:=Range("U2:U" & z), Type:=xlFillDefault Range("V2").AutoFill Destination:=Range("V2:V" & z), Type:=xlFillDefault Range("W2").AutoFill Destination:=Range("W2:W" & z), Type:=xlFillDefault Range("X2").AutoFill Destination:=Range("X2:X" & z), Type:=xlFillDefault Range("S" & z1).Select ActiveCell.FormulaR1C1 = Application.Sum(Range("S2:S" & z))

Range("T" & z1).Select ActiveCell.FormulaR1C1 = Application.Sum(Range("T2:T" & z)) Range("W" & z1).Select ActiveCell.FormulaR1C1 = Application.Sum(Range("W2:W" & z)) Range("X" & z1).Select ActiveCell.FormulaR1C1 = Application.Sum(Range("X2:X" & z)) Range("S" & z2).Select ActiveCell.FormulaR1C1 = "=R[-1]C*" & SH / 2 Range("T" & z2).Select ActiveCell.FormulaR1C1 = "=R[-1]C*" & SH / (2 * 1000000) Range("W" & z2).Select ActiveCell.FormulaR1C1 = "=R[-1]C*" & SH / 2 Range("X" & z2).Select ActiveCell.FormulaR1C1 = "=R[-1]C*" & SH / 2 Range("Q" & z3).Select ActiveCell.FormulaR1C1 = "Steel in kg" Range("S" & z3).Select ActiveCell.FormulaR1C1 = "=R[-1]C*7850" Selection.Font.Bold = True Range("T" & z3).Select ActiveCell.FormulaR1C1 = "=R[-1]C*7850" Selection.Font.Bold = True Range("W" & z3).Select ActiveCell.FormulaR1C1 = "=R[-1]C*7850" Selection.Font.Bold = True Range("X" & z3).Select ActiveCell.FormulaR1C1 = "=R[-1]C*7850" Selection.Font.Bold = True Range("Q" & z4).Select ActiveCell.FormulaR1C1 = "Steel in MT" Selection.Font.Bold = True Range("S" & z4).Select ActiveCell.FormulaR1C1 = "=R[-1]C/1000" Selection.Font.Bold = True Range("T" & z4).Select ActiveCell.FormulaR1C1 = "=R[-1]C/1000" Selection.Font.Bold = True Range("W" & z4).Select ActiveCell.FormulaR1C1 = "=R[-1]C/1000" Selection.Font.Bold = True Range("X" & z4).Select ActiveCell.FormulaR1C1 = "=R[-1]C/1000" Selection.Font.Bold = True Range("Q" & z3).Select ActiveCell.FormulaR1C1 = "Total Steel in MT" Selection.Font.Bold = True Range("S" & z5).Select ActiveCell.FormulaR1C1 = "=SUM(R[-1]C:R[-1]C[5])" Selection.Font.Bold = True End Sub

Potrebbero piacerti anche