Format de nombre (numberformat)

CharlesSSQ

XLDnaute Junior
Bonjour!

Voici une partie d'une macro qui prend un chiffre dans une sheet et met l'info dans une autre sheet. Les chiffres se trouvent à être sous cette forme ex: 1,47% dans excel. et lorsque la macro roule elle les place dans l'autre sheet sous cette forme 0,0147. que devrais-je mettre à numberformat pour corriger cela?

Merci beaucoup!
Charles


For i = 1 To 100
tickerrecherche = ticker(i)
Set Ligneticker = Range("A1:A10000").Find(tickerrecherche, LookIn:=xlValues, LookAt:=xlWhole)
If Not Ligneticker Is Nothing Then
frais = Ligneticker.Row
Cells(frais, 6) = valeur(i)
With Application.Workbooks(WORKBOOK_GUIDE).Sheets(SHEET_TRAVAIL_GUIDE).Cells(frais, 6)
.Value = valeur(i)
.NumberFormat = "0,00"
End With
End If
Next i
 

CharlesSSQ

XLDnaute Junior
Re : Format de nombre (numberformat)

allo,

voici la macro au complet, on dirait que le format se conserve du fichier source...

encore merci!!

Application.Workbooks(WORKBOOK_DATA).Activate
Sheets(SHEET_TRAVAIL_FRAIS).Select

For i = 1 To 100
ticker(i) = Cells(4, i).Value
valeur(i) = Cells(6, i).Value

Next i

Application.Workbooks(WORKBOOK_GUIDE).Activate
Sheets(SHEET_TRAVAIL_GUIDE).Select

With Range("F2:F61")
.ClearContents
.ClearFormats
End With


For i = 1 To 100
tickerrecherche = ticker(i)
Set Ligneticker = Range("A1:A10000").Find(tickerrecherche, LookIn:=xlValues, LookAt:=xlWhole)
If Not Ligneticker Is Nothing Then
frais = Ligneticker.Row
Cells(frais, 6) = valeur(i)
With Application.Workbooks(WORKBOOK_GUIDE).Sheets(SHEET_TRAVAIL_GUIDE).Cells(frais, 6)
.Value = valeur(i)
.NumberFormat = "0,00%"

End With
End If
Next i



End Sub
 

Discussions similaires

Statistiques des forums

Discussions
312 400
Messages
2 088 087
Membres
103 712
dernier inscrit
Charles authentique