View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
George[_4_] George[_4_] is offline
external usenet poster
 
Posts: 19
Default Type mismatch...

When running the following Visual Basic code a run time error occurs
saying that there is a type mismatch. The name txtRemoveSheet is from a
textbox. My assumption was that it should be of type string and that
the Delete method accepted strings. Is this assumption correct? I
don't see why txtRemoveSheet is not accepted, can someone enlighten me?

Private Sub cmdDelete_Click()
Worksheets(txtRemoveSheet).Delete
txtRemoveSheet.Text = ""
End Sub

Thank you,
George