S
sam.fares
I have created a user form with two options.
First option the designer could select "ALL" to design all
marks(J1,J2,J3,..........) which are shown in column A. the number of
those of marks in that column is determinied by the Variable "Nu".
how can i code when some one select" ALL" in the userform, to tell it
that" Nu" is equal to the value as shown in the attached code.
Second Option is for the designer to "Select Mark", where he would type
the mark in the textbox next to that option, and then the program will
analyse that specific mark. The marks can be
(J1,J2,J3......................).
right now the program will analyze all the marks in that column. i just
would like to make it more flexible.
the name of the userform is "JOISTMARKS".
I apprecaite any help!
This is part of the code :
'Get the mark
'Nu = Int(Application.InputBox("Number of Joist marks?"))
JOISTMARKS.Show
Nu = shtQDS.Range("BC1").Value
For Z = 1 To Nu Step 1
strMark = "J" & Z
Application.ScreenUpdating = False
'Error check
'If strMark = "" Then
' MsgBox "No mark chosen. Analysis cancelled."
'GoTo CancelAnalysis
'End If
'Clear old data
shtEM.Range("B2:B9").clearcontents
shtEM.Range("B10:C13").clearcontents
shtPA.Range("B33:AO44").clearcontents
shtPA.Range("B66:AO76").clearcontents
'shtNCS.Range("A3:H1000").clearcontents
shtResults.Range("A3:AR65536").clearcontents
shtNPCJ.Range("B10:C13").clearcontents
intResultRow = 3
'Set initial values
i = 3
intLines = 0
intLoadCase = 1
boolCancel = False
Application.ScreenUpdating = False
Worksheets.Add after:=Worksheets(Worksheets.Count)
NewSheet = ActiveSheet.Name
With Worksheets(NewSheet)
.Move after:=Worksheets(Worksheets.Count)
.Name = strMark
.Activate
Columns("A:A").ColumnWidth = 51.14
Columns("B:AR").Select
Selection.ColumnWidth = 13
ActiveWindow.Zoom = 75
End With
'Find out how many load cases we're dealing with
Do
If shtQDS.Cells(i, 1).Value = strMark Then
If shtQDS.Cells(i, 4).Value > intLoadCases Then intLoadCases =
shtQDS.Cells(i, 4).Value
End If
i = i + 1
Loop Until IsEmpty(shtQDS.Cells(i, 1))
..
..
..
...
First option the designer could select "ALL" to design all
marks(J1,J2,J3,..........) which are shown in column A. the number of
those of marks in that column is determinied by the Variable "Nu".
how can i code when some one select" ALL" in the userform, to tell it
that" Nu" is equal to the value as shown in the attached code.
Second Option is for the designer to "Select Mark", where he would type
the mark in the textbox next to that option, and then the program will
analyse that specific mark. The marks can be
(J1,J2,J3......................).
right now the program will analyze all the marks in that column. i just
would like to make it more flexible.
the name of the userform is "JOISTMARKS".
I apprecaite any help!
This is part of the code :
'Get the mark
'Nu = Int(Application.InputBox("Number of Joist marks?"))
JOISTMARKS.Show
Nu = shtQDS.Range("BC1").Value
For Z = 1 To Nu Step 1
strMark = "J" & Z
Application.ScreenUpdating = False
'Error check
'If strMark = "" Then
' MsgBox "No mark chosen. Analysis cancelled."
'GoTo CancelAnalysis
'End If
'Clear old data
shtEM.Range("B2:B9").clearcontents
shtEM.Range("B10:C13").clearcontents
shtPA.Range("B33:AO44").clearcontents
shtPA.Range("B66:AO76").clearcontents
'shtNCS.Range("A3:H1000").clearcontents
shtResults.Range("A3:AR65536").clearcontents
shtNPCJ.Range("B10:C13").clearcontents
intResultRow = 3
'Set initial values
i = 3
intLines = 0
intLoadCase = 1
boolCancel = False
Application.ScreenUpdating = False
Worksheets.Add after:=Worksheets(Worksheets.Count)
NewSheet = ActiveSheet.Name
With Worksheets(NewSheet)
.Move after:=Worksheets(Worksheets.Count)
.Name = strMark
.Activate
Columns("A:A").ColumnWidth = 51.14
Columns("B:AR").Select
Selection.ColumnWidth = 13
ActiveWindow.Zoom = 75
End With
'Find out how many load cases we're dealing with
Do
If shtQDS.Cells(i, 1).Value = strMark Then
If shtQDS.Cells(i, 4).Value > intLoadCases Then intLoadCases =
shtQDS.Cells(i, 4).Value
End If
i = i + 1
Loop Until IsEmpty(shtQDS.Cells(i, 1))
..
..
..
...