Hi all
The following code works except that it defaults every time to the else clause - or seems to. The First part of the if clause should capture any Race Number (using count) that is less than ten and add a zero preceeding the race number in the HTML statement. Currently, evertime I run the code, I do not get a zero - every line seems to have picked up the else clause. This seems very illogical as the count starts from one, so it should automatiaccly default to the first part of the clause.
Here is the code in question. The input sheet is basically
C3 = PT
C4 = 8
D3 = PG
D4 = 12
Sub MainInput()
Dim Count As Integer
Dim PoVal As String
Dim Cter As Integer
Cter = 1
Call CleanSheets
Do Until IsEmpty(ActiveCell)
PoVal = ActiveCell.Offset(-1, 0)
For Count = 1 To (ActiveCell.Value)
If Count < 10 Then Worksheets("HTML Creator").Cells(Cter, "A") = _
" & _
Worksheets("Race Details Entry").Range("$C$17").Value & "/" & _
Worksheets("Race Details Entry").Range("$D$17").Value & "/" & _
Worksheets("Race Details Entry").Range("$E$17").Value & "/" & _
PoVal & "0" & Count & ".html" Else
Worksheets("HTML Creator").Cells(Cter, "A") = _
" & _
Worksheets("Race Details Entry").Range("$C$17").Value & "/" & _
Worksheets("Race Details Entry").Range("$D$17").Value & "/" & _
Worksheets("Race Details Entry").Range("$E$17").Value & "/" & _
PoVal & Count & ".html"
Sheets("HTML Creator").Select
ActiveCell.Offset(2, 0).Select
Cter = Cter + 2
Next Count
Sheets("Race Details Entry").Select
ActiveCell.Offset(0, 1).Select
Loop
End Sub
I have tried to heaps of things to get it to work, to no avail - including adding another variable to count the race numbers seperately to the count integer. Nothing seems to work for me. The webiste to resolve needs two digits - thus my problem
Thanks for any help you might be able to give
Cheers
GV
The following code works except that it defaults every time to the else clause - or seems to. The First part of the if clause should capture any Race Number (using count) that is less than ten and add a zero preceeding the race number in the HTML statement. Currently, evertime I run the code, I do not get a zero - every line seems to have picked up the else clause. This seems very illogical as the count starts from one, so it should automatiaccly default to the first part of the clause.
Here is the code in question. The input sheet is basically
C3 = PT
C4 = 8
D3 = PG
D4 = 12
Sub MainInput()
Dim Count As Integer
Dim PoVal As String
Dim Cter As Integer
Cter = 1
Call CleanSheets
Do Until IsEmpty(ActiveCell)
PoVal = ActiveCell.Offset(-1, 0)
For Count = 1 To (ActiveCell.Value)
If Count < 10 Then Worksheets("HTML Creator").Cells(Cter, "A") = _
" & _
Worksheets("Race Details Entry").Range("$C$17").Value & "/" & _
Worksheets("Race Details Entry").Range("$D$17").Value & "/" & _
Worksheets("Race Details Entry").Range("$E$17").Value & "/" & _
PoVal & "0" & Count & ".html" Else
Worksheets("HTML Creator").Cells(Cter, "A") = _
" & _
Worksheets("Race Details Entry").Range("$C$17").Value & "/" & _
Worksheets("Race Details Entry").Range("$D$17").Value & "/" & _
Worksheets("Race Details Entry").Range("$E$17").Value & "/" & _
PoVal & Count & ".html"
Sheets("HTML Creator").Select
ActiveCell.Offset(2, 0).Select
Cter = Cter + 2
Next Count
Sheets("Race Details Entry").Select
ActiveCell.Offset(0, 1).Select
Loop
End Sub
I have tried to heaps of things to get it to work, to no avail - including adding another variable to count the race numbers seperately to the count integer. Nothing seems to work for me. The webiste to resolve needs two digits - thus my problem
Thanks for any help you might be able to give
Cheers
GV