Hi Board,
I've got a bit of a problem here. I've got a bit of code which fails to recognise the Friday condition to display Msg "Friday". Any ideas
And how can I look up the value Sheet1 A1 date in another spread sheet and copy & paste a range from Sheet 1 to the right of the date on say Sheet2 ???
Puzzled
Pls help
Private Sub Update()
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
If Weekday(Worksheets("Sheet1").Range("A1").Value, vbMonday) > 5 Then
Msg = "You can not enter Rates for Saturday or Sunday"
Style = vbOKOnly + vbExclamation
MsgBox Msg, Style
Else
If Weekday(Worksheets("Sheet1").Range("A1").Value, vbMonday) = 6 Then
Msg = "Friday"
Else
Msg = "Do you want to copy the Rates for" & Sheets("Sheet1").Range("A1")
Style = vbYesNo + vbQuestion
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then
Msg = "Test"
Else
MyString = "No" '
End If
End If
End If
End Sub
I've got a bit of a problem here. I've got a bit of code which fails to recognise the Friday condition to display Msg "Friday". Any ideas
And how can I look up the value Sheet1 A1 date in another spread sheet and copy & paste a range from Sheet 1 to the right of the date on say Sheet2 ???
Puzzled
Pls help
Private Sub Update()
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
If Weekday(Worksheets("Sheet1").Range("A1").Value, vbMonday) > 5 Then
Msg = "You can not enter Rates for Saturday or Sunday"
Style = vbOKOnly + vbExclamation
MsgBox Msg, Style
Else
If Weekday(Worksheets("Sheet1").Range("A1").Value, vbMonday) = 6 Then
Msg = "Friday"
Else
Msg = "Do you want to copy the Rates for" & Sheets("Sheet1").Range("A1")
Style = vbYesNo + vbQuestion
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then
Msg = "Test"
Else
MyString = "No" '
End If
End If
End If
End Sub