Salut providence,
ton algorithme est faux, en effet ta boucle compte en fait a priori le nombre de 1 dans 2007 pages et non le nombre de pages pour avoir 2007 "1", il faudrait plutôt écrire
Function test() As Integer
Dim int_I, Int_Pages As Integer
Dim str_Temp As String
int_I = 0
Int_Pages = 0
While int_I < 2007
Int_Pages = Int_Pages + 1
str_Temp = Int_Pages
While InStr(1, str_Temp, "1") > 0
int_I = int_I + 1
str_Temp = Right(str_Temp, Len(str_Temp) - InStr(1, str_Temp, "1"))
Wend
Wend
test = Int_Pages
End Function
et tu obtiens 3169 pages
Irem