K
Kieranz
Hi All and especially NickHK and Niek Otten
I wish to print certificate for the Winner and RunnerUp in different
Categories.
When I debug with 'F8' and it comes to Sub line 07 the debug goes
to either of the two Function code. I don't understand why. Also the
scoresheet goes ### where the function is.
However when in debug and I hover the cursor on the Sub line 07 the
comment shows the message "shCert09.Range("AE3")=<Object variable
or With block variable not set>".
I have scoresheet, leaderboardsheet and Certificatesheet. Using XP with
XL03.
Any help appreciated
Thks
Option Explicit
Sub proPrintCert09()
01 Dim Cat As String
02 Dim Pos As String 'Winner or RunnerUp
03 Dim Nam As String 'Golfer name
04 Dim iR As Integer 'row no
05 shLBrd.Range("P79").Select
06 Cat = ActiveCell.Value 'say 9 hole
07 shCert09.Range("AE3") = Cat
08 For iR = 1 To 2
09 Nam = ActiveCell.Offset(iR + 2, 0).Value
10 Pos = ActiveCell.Offset(iR + 2, 7).Value
11 shCert09.Range("AE3") = Cat
12 shCert09.Range("AE4") = Pos
13 shCert09.Range("AE5") = Nam
14 Application.ScreenUpdating = False
15 shCert09.PrintOut
16 Next iR
End Sub
Function NetF9(GSc As Range, HC As Range)
01 If GSc = "" Then
02 NetF9 = ""
03 Exit Function
04 End If
05 If WorksheetFunction.IsText(GSc) Then
06 NetF9 = GSc
07 Else
08 NetF9 = GSc - (WorksheetFunction.RoundUp(HC / 2, 0))
09 End If
End Function
Function GScore(HSc As Range)
01 Dim i As Long
02 For i = 1 To HSc.Cells.Count
03 If HSc(1) = "" Then
04 GScore = ""
05 Exit Function
06 End If
07 If HSc(i) = "d" Then
08 GScore = "DQ"
09 Exit Function
10 End If
11 If HSc(i) = "n" Then
12 GScore = "NR"
13 Exit Function
14 End If
15 If HSc(i) = "r" Then
16 GScore = "RTD"
17 Exit Function
18 End If
19 GScore = GScore + HSc(i)
20 Next i
End Function
I wish to print certificate for the Winner and RunnerUp in different
Categories.
When I debug with 'F8' and it comes to Sub line 07 the debug goes
to either of the two Function code. I don't understand why. Also the
scoresheet goes ### where the function is.
However when in debug and I hover the cursor on the Sub line 07 the
comment shows the message "shCert09.Range("AE3")=<Object variable
or With block variable not set>".
I have scoresheet, leaderboardsheet and Certificatesheet. Using XP with
XL03.
Any help appreciated
Thks
Option Explicit
Sub proPrintCert09()
01 Dim Cat As String
02 Dim Pos As String 'Winner or RunnerUp
03 Dim Nam As String 'Golfer name
04 Dim iR As Integer 'row no
05 shLBrd.Range("P79").Select
06 Cat = ActiveCell.Value 'say 9 hole
07 shCert09.Range("AE3") = Cat
08 For iR = 1 To 2
09 Nam = ActiveCell.Offset(iR + 2, 0).Value
10 Pos = ActiveCell.Offset(iR + 2, 7).Value
11 shCert09.Range("AE3") = Cat
12 shCert09.Range("AE4") = Pos
13 shCert09.Range("AE5") = Nam
14 Application.ScreenUpdating = False
15 shCert09.PrintOut
16 Next iR
End Sub
Function NetF9(GSc As Range, HC As Range)
01 If GSc = "" Then
02 NetF9 = ""
03 Exit Function
04 End If
05 If WorksheetFunction.IsText(GSc) Then
06 NetF9 = GSc
07 Else
08 NetF9 = GSc - (WorksheetFunction.RoundUp(HC / 2, 0))
09 End If
End Function
Function GScore(HSc As Range)
01 Dim i As Long
02 For i = 1 To HSc.Cells.Count
03 If HSc(1) = "" Then
04 GScore = ""
05 Exit Function
06 End If
07 If HSc(i) = "d" Then
08 GScore = "DQ"
09 Exit Function
10 End If
11 If HSc(i) = "n" Then
12 GScore = "NR"
13 Exit Function
14 End If
15 If HSc(i) = "r" Then
16 GScore = "RTD"
17 Exit Function
18 End If
19 GScore = GScore + HSc(i)
20 Next i
End Function