TaylorDavidI
Technical User
I've been working on this spread sheet for a few months now, mostly because it's not critical and I'm just doing it in my spare time.
The section of code in question works fine under most circumstances; however, when "ClassBox" is not empty then it's failing to call the "Feats" sub on the final iteration of the loop (the only time when ClassBox is checked).
All of the other sub calls work perfectly on every iteration of the loop. I've also tried placing the call to Feats in the If statement itself (where I have them commented out now).
I placed some debugging boxes before the call to Feats and at the beginning of Feats, neither even triggered when ClassBox was non-empty.
The function is called by one of four command buttons on a userform when they're completed running their code.
Can anyone tell me what might be causing that line of code to not run? And my appologies for the terrible style and inefficiency. I'll be working on that once I get it working.
David I. Taylor
A+, Network+, MCP Windows XP
The section of code in question works fine under most circumstances; however, when "ClassBox" is not empty then it's failing to call the "Feats" sub on the final iteration of the loop (the only time when ClassBox is checked).
Code:
Private Sub Finish(TotHD As Integer)
Dim x As Integer
Call GeneralInfo
AbilitySelect.Show
Sheet2.Unprotect myPassword
For x = 1 To TotHD
If x = 1 Then
If TypeBox.Value <> "Humanoid" Or HDbox.Value > 0 Then InitialProf TypeBox.Value
InitialProf RaceBox.Value
If RaceBox.Value = "Human" Then
Load AddFeat
AddFeat.SetAvailable
AddFeat.Show
End If
End If
If x = TotHD And ClassBox.Value <> "" Then
Sheet2.Cells(5, 2).Value = ClassBox.Value
Sheet2.Cells(5, 10).Value = 1
InitialProf ClassBox.Value
SkillPoints (x, TotHD)
If ClassBox.Value = "Fighter" Then
Load FighterFeat
FighterFeat.SetAvailable
FighterFeat.Show
End If
If ComboBox1.Value = "Expert" Then
Load ExpertSkills
ExpertSkills.Show
End If
'Feats x
Else
Sheet2.[J4].Value = CInt(Sheet2.[J4].Value) + 1
SkillPoints (x, TotHD)
'Feats x
End If
Feats x
Next x
Sheet2.Protect myPassword
End Sub
Private Sub Feats(HD As Integer)
If HD = 1 Or IsDivis(HD, 3) Then
Load AddFeat
If HD <= CInt(HDbox.Value) Then
AddFeat.SetRace RaceBox.Value
Else
AddFeat.SetClass ClassBox.Value
End If
AddFeat.SetAvailable
AddFeat.Show
End If
End Sub
All of the other sub calls work perfectly on every iteration of the loop. I've also tried placing the call to Feats in the If statement itself (where I have them commented out now).
I placed some debugging boxes before the call to Feats and at the beginning of Feats, neither even triggered when ClassBox was non-empty.
The function is called by one of four command buttons on a userform when they're completed running their code.
Can anyone tell me what might be causing that line of code to not run? And my appologies for the terrible style and inefficiency. I'll be working on that once I get it working.
David I. Taylor
A+, Network+, MCP Windows XP