XL 2010 conversion en nombre depuis vba

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

gh4

XLDnaute Occasionnel
Bonjour a tous et toutes,
petit souci avec une macro et je n'y arrive pas malgré mes recherches

j'ecris dans une cellule par le resultat d'une textbox
cells (lign-1,1)=textbox1
le resultat dans la cellule colon 5 de la feuille ne se met pas au format nombre et m’empêche de faire des calculs avec une autre cellule avec mise en forme conditionnelle colon 4

voici un bout de la macro dans le userform

Sheets("stock general").Cells(lign + 1, 4).Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreater, _
Formula1:="=$E3"
Selection.FormatConditions(1).Interior.ColorIndex = 35
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=$E3"
Selection.FormatConditions(2).Interior.ColorIndex = 3

With ActiveSheet.Columns(4)
.NumberFormat = "General"
.TextToColumns DataType:=xlDelimited, FieldInfo:=Array(1, 1)
End With

'Sheets("stock general").Cells(lign + 1, 5).Select
' With ActiveSheet.Columns(4)
' .NumberFormat = "General"
' .TextToColumns DataType:=xlDelimited, FieldInfo:=Array(1, 1)
'End With

'With Selection
' Selection.NumberFormat = "0"
'End With




Cells(lign + 1, 1) = TextBox1
Cells(lign + 1, 2) = TextBox2

Cells(lign + 1, 3) = TextBox3
Cells(lign + 1, 5) = TextBox4

par avance je vous remercie pour votre aide
 
bonjour
un textbox renvoie du texte : normal
exemple ( a condition que dans la textbox , il y a une valeur qui peut être transformée en numérique, sinon plantage , réaliser une gestion d'erreur)
Cells(lign + 1, 1) = cdbl(TextBox1)
 
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
2
Affichages
1 K
  • Question Question
Microsoft 365 colorer une plage
Réponses
2
Affichages
842
Réponses
22
Affichages
3 K
Réponses
16
Affichages
3 K
Retour