View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Type mismatch...

I don't know why it didn't work for you. Maybe it has something to do with
what's in that textbox???

You may want to share that value.

George wrote:

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


--

Dave Peterson