Greetings,
i want to clear cells from a certain worksheet name and certain range, so i figured i'd use variables but an error appears saying they can't accept the syntax.
here's my code
Public Sub deltime()
Dim wsheet As String
Dim strt As String
Dim endc As String
wsheet = Range("A2").Value
strt = Range("B2").Value
endc = Range("C2").Value
Worksheets(wsheet).Range(strt:endc).ClearContents
End Sub
i know this is a noob question, but i need help,
i want to clear cells from a certain worksheet name and certain range, so i figured i'd use variables but an error appears saying they can't accept the syntax.
here's my code
Public Sub deltime()
Dim wsheet As String
Dim strt As String
Dim endc As String
wsheet = Range("A2").Value
strt = Range("B2").Value
endc = Range("C2").Value
Worksheets(wsheet).Range(strt:endc).ClearContents
End Sub
i know this is a noob question, but i need help,

Last edited: