Hi everyone, i have a user form that uses all combo box (drop-downs). Can some help me to modify this code to throw up a message box saying "finish form" before it transfers the data (unload me)?
Thanks a ton sd
Thanks a ton sd
Code:
Private Sub CommandButton1_Click()
Dim ws As Worksheet, rngFind, rngRow As Range
Set ws = ThisWorkbook.Sheets("StoreHours")
StoreNumber = Worksheets("MyStoreInfo").Range("C2")
Set rngFind = ws.Range("C:C").Find(what:=StoreNumber, MatchCase:=True)
If Not rngFind Is Nothing Then
rngFind.Offset(0, 3).Value = Me.SundayOpen.Value
rngFind.Offset(0, 4).Value = Me.SundayClose.Value
rngFind.Offset(0, 5).Value = Me.MondayOpen.Value
rngFind.Offset(0, 6).Value = Me.MondayClose.Value
rngFind.Offset(0, 7).Value = Me.TuesdayOpen.Value
rngFind.Offset(0, 8).Value = Me.TuesdayClose.Value
rngFind.Offset(0, 9).Value = Me.WednesdayOpen.Value
rngFind.Offset(0, 10).Value = Me.WednesdayClose.Value
rngFind.Offset(0, 11).Value = Me.ThursdayOpen.Value
rngFind.Offset(0, 12).Value = Me.ThursdayClose.Value
rngFind.Offset(0, 13).Value = Me.FridayOpen.Value
rngFind.Offset(0, 14).Value = Me.FridayClose.Value
rngFind.Offset(0, 15).Value = Me.SaturdayOpen.Value
rngFind.Offset(0, 16).Value = Me.SaturdayClose.Value
rngFind.Offset(0, 17).Value = Me.Month.Value
rngFind.Offset(0, 18).Value = Me.Year.Value
MsgBox "Store Hours have been updated)", vbInformation, "Update Store Hours"
Unload Me
Else
MsgBox "Your Store Number is not input on the MY STORE INFO Tab", vbInformation, "Update Store Hours"
End If
End Sub