Hi-
For Each s In Worksheets("sheet2").Range("a1:a100")
If s.Value = date_form.Calendar3.Value Then
x = s.Offset(0, 1).Value
If Sheets(x).Value = True Then
Sheets(x).Activate
Else
ActiveWorkbook.Sheets.Add().Name = x.Value
sheets(x).Activate
End If
End If
Next s
In this code x stands for the name of the sheet that the code has to find. If x is not true then I want the code to make up a sheet with the name from x.value. I also need the code to activate the sheet. How can I rewrite this so I dont keep getting an error? Thanks
For Each s In Worksheets("sheet2").Range("a1:a100")
If s.Value = date_form.Calendar3.Value Then
x = s.Offset(0, 1).Value
If Sheets(x).Value = True Then
Sheets(x).Activate
Else
ActiveWorkbook.Sheets.Add().Name = x.Value
sheets(x).Activate
End If
End If
Next s
In this code x stands for the name of the sheet that the code has to find. If x is not true then I want the code to make up a sheet with the name from x.value. I also need the code to activate the sheet. How can I rewrite this so I dont keep getting an error? Thanks