Merci à vous trois
Je pense que Yeahou avait compris car du textbox va vers range et non range vers textbox.
Mais dommage ca ne fonctionne pas!!!
La voici au complet j'y ai mi le code vers le centre:
Private Sub CommandButton3_Click()
Dim r
r = (Left(TextBox1, 1))
debut:
If TextBox1.Value = '' Then
MsgBox ' Vous devez remplir tous les champs '
Else
If TextBox2.Value = '' Then
MsgBox ' Vous devez remplir tous les champs '
Else
If TextBox3.Value = '' Then
MsgBox ' Vous devez remplir tous les champs '
Else
If TextBox4.Value = '' Then
MsgBox ' Vous devez remplir tous les champs '
Else
If TextBox6.Value = '' Then
MsgBox ' Vous devez remplir tous les champs '
'TextBox1.SetFocus
GoTo debut
Else
Sheets(r).Select
Range('A65000').End(xlUp).Offset(1, 0).Select
Range(ActiveCell, ActiveCell.Offset(4, 1)).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
ActiveCell = TextBox1
ActiveCell.Offset(2, 0).Value = TextBox2
ActiveCell.Offset(1, 0).Value = TextBox6
ActiveCell.Offset(3, 0).Value = TextBox3
TextBox1.Value = Replace(expression:=TextBox1.Value, Find:=' ', Replace:='')
ActiveCell.Offset(4, 0).Value = TextBox4
ActiveCell.Offset(0, 1) = TextBox5
Select Case MsgBox('Do you klick yes or no?!', vbYesNo)
Case vbYes
TextBox1 = ''
TextBox2 = ''
TextBox3 = ''
TextBox4 = ''
TextBox5 = ''
TextBox6 = ''
Range('A65000').End(xlUp).Offset(1, 0).Select
Case vbNo
UserForm1.Hide
End Select
End If
End If
End If
End If
End If
End Sub
À moins que comme Renato ptêtre dans la feuil je met la feuil au complet au format sans espace(mais comment?)
Merci
Temjeh