Hi I have the following code on a command button, the code runs on 2 other worksheets as well as this one - I need to protect the worksheets (formulas) but need the command button to still work, is that possible?
As I have tried several different methods and can't get one to work! Thanks
The 3 sheets are named as hawksworth, dibble & taylor
Sub NextSheet_Click()
Dim fname As String
Application.ScreenUpdating = False
'increment hawksworth days stopped including date and/or time
On Error Resume Next
Set cellrange1 = Range("N8:N47")
If Range("O1").Value = "1530" Then
Range("O1").Value = "0600"
Range("M1").Value = Range("M1").Value + 1
For Each cel In cellrange1
If cel.Value <> "" Then
cel.Value = cel.Value + 1
End If
Next
Set DateRange1 = Range("M8:M47")
For Each releasedate In DateRange1
If releasedate.Value <> "" Then
If releasedate.Value < Range("M1").Value Then
releasedate.Value = releasedate.Value + 1
End If
As I have tried several different methods and can't get one to work! Thanks
The 3 sheets are named as hawksworth, dibble & taylor
Sub NextSheet_Click()
Dim fname As String
Application.ScreenUpdating = False
'increment hawksworth days stopped including date and/or time
On Error Resume Next
Set cellrange1 = Range("N8:N47")
If Range("O1").Value = "1530" Then
Range("O1").Value = "0600"
Range("M1").Value = Range("M1").Value + 1
For Each cel In cellrange1
If cel.Value <> "" Then
cel.Value = cel.Value + 1
End If
Next
Set DateRange1 = Range("M8:M47")
For Each releasedate In DateRange1
If releasedate.Value <> "" Then
If releasedate.Value < Range("M1").Value Then
releasedate.Value = releasedate.Value + 1
End If