ws.Cells(row, 5).Value = U((node.
NodeID - 1) * 6 + 4) ' Rx
ws.Cells(row, 6).Value = U((node.NodeID - 1) * 6 + 5) ' Ry
ws.Cells(row, 7).Value = U((node.NodeID - 1) * 6 + 6) ' Rz
row = row + 1
Next node
' Output member forces
row = 2
Dim mem As clsMember
For Each mem In MemberList
ws.Cells(row, 9).Value = mem.MemberID
ws.Cells(row, 10).Value = mem.AxialForce
ws.Cells(row, 11).Value = mem.ShearForceY
ws.Cells(row, 12).Value = mem.ShearForceZ
ws.Cells(row, 13).Value = mem.MomentY
ws.Cells(row, 14).Value = mem.MomentZ
ws.Cells(row, 15).Value = mem.Torsion
row = row + 1
Next mem
' Format results
ws.Columns("B:G").NumberFormat = "0.000E+00"
ws.Columns("J:O").NumberFormat = "0.000"
End Sub
Private Sub SetupDataSheets()
' Ensure all required worksheets exist
Dim ws As Worksheet
Dim sheetNames As Variant
Dim i As Integer
sheetNames = Array("Data", "Materials", "Sections", "Load Cases",
"Results", "Structure Plot", "Design Checks")
' Delete existing sheets (except the first one which must exist)
Application.DisplayAlerts = False
For i = 1 To ThisWorkbook.Worksheets.Count
If i > UBound(sheetNames) + 1 Then
ThisWorkbook.Worksheets(i).Delete
End If
Next i
' Add missing sheets
For i = 0 To UBound(sheetNames)
On Error Resume Next
Set ws = ThisWorkbook.Worksheets(sheetNames(i))
On Error GoTo 0
If ws Is Nothing Then
Set ws =
ThisWorkbook.Worksheets.Add(After:=ThisWorkbook.Worksheets(ThisWorkbook.Works
heets.Count))
ws.Name = sheetNames(i)
End If
Next i
Application.DisplayAlerts = True
P a g e 26 | 57