Hi,
This should be easy but so far I’m unable to get it correct.
In the supplied code when the date is entered into the cell in my worksheet I also require the same cell to be Red.
Code
- Private Sub DateTransferButton_Click() Dim sh As Worksheet Dim b As Range Dim wName As String, res As Variant If NameForDateEntryBox.ListIndex = -1 Then MsgBox "Please Select A Customer Before Pressing Transfer Button", vbCritical, "Delivery Parcel Date Transfer Message" Exit Sub End If If TextBox7.Value = "" Or Not IsDate(TextBox7.Value) Then MsgBox "Please Enter A Valid Date", vbCritical, "Delivery Parcel Date Transfer Message" TextBox7 = "" TextBox7.SetFocus Exit Sub End If wName = NameForDateEntryBox.List(NameForDateEntryBox.ListIndex) Set sh = Sheets("POSTAGE") Set b = sh.Columns("B").Find(wName, LookIn:=xlValues, lookat:=xlWhole) If Not b Is Nothing Then If sh.Cells(b.Row, "G").Value <> "" Then MsgBox "DATE HAS BEEN ENTERED ALREADY !" & vbCrLf & "Click OK To Go Check It Out ", vbCritical, "Delivery Parcel Date Transfer Message" TextBox7 = "" Unload PostageTransferSheet Cells(b.Row, "G").Select Else sh.Cells(b.Row, "G").Value = CDate(TextBox7.Value) MsgBox "Delivery Date Updated Sucessfully", vbInformation, "Delivery Parcel Date Transfer Message" Call UserForm_Initialize End If End If NameForDateEntryBox = "" TextBox7 = "" TextBox7.Value = Format(CDbl(Date), "dd/mm/yyyy") End Sub