Hello all,
I hope you can assist.
I am trying to capture the current worksheet name, switch to another worksheet then delete that name from a list in a range. The routine appears to complain at the "find" part, not liking envtodelete as a variable.
Any assistance warmly recieved, thankyou
Paul
***
Sub RemoveEnvFromTimecalc()
ActiveSheet.Name = thissheet
Dim envtodelete As New DataObject
envtodelete.SetText thissheet
envtodelete.PutInClipboard
Sheets("TimeCalc").Select
Range("B29:R29").Select
Selection.Find(What:=envtodelete, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Selection.ClearContents
End Sub
Bookmarks