Bonjour à tous
pour facilité la navigation et la saisie dans le classeur, je souhaiterais qu'à la fermeture d'un MsgBox, le curseur se retrouve automatiquement sur la ligne suivante dans la colonne "A". Le but étant que les utilisateurs ne se retrouvent pas par défaut dans la colonne "H" en faisant tab après avoir confirmer l'enregistrement de leur ligne. Merci d'avance.
Voici le code qui déclenche l'Userform suivi du MsgBox:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
adresse = Target.Address
For i = 5 To 65536
If adresse = "$B$" & i Then
Calendrier.Show
Cancel = True
Exit For
End If
Next
If Target.Count > 1 Then Exit Sub
If Not Application.Intersect(Target, Range("h5:H" & Range("B" & Rows.Count).End(xlUp).Row)) Is Nothing Then
Liste.Show
End If
If Target.Count > 1 Then Exit Sub
If Not Application.Intersect(Target, Range("G5:G" & Range("B" & Rows.Count).End(xlUp).Row)) Is Nothing Then
Confirmation.Show
End If
End Sub
Voici le code de l'UserForm:
Private Sub CommandButton1_Click()
'ActiveSheet.Unprotect Password:="mldc"
'copie l'infos dans la colonne H
With Sheets("Demandes")
.Range("A" & ActiveCell.Row & ":H" & ActiveCell.Row).Interior.Color = RGB(192, 0, 32)
.Range("H" & ActiveCell.Row) = "À combler"
End With
MsgBox "Votre demande a été enregistrée."
ThisWorkbook.Save
Unload Me
'Target????
'ActiveSheet.Protect Password:="mldc"
End Sub