View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default user form error 9

Subscript out of range is associate with the error 9. That usually refers
to the sheet name or a workbook name.

If you have something like

Worksheets("Sheet1").Range("A1:F9")

then that "Sheet1" is constant - it doesn't adjust if you change the sheet
name. Check such references in your code.

Also be aware that a sheet tab name may have a space at the end that makes
it hard to recognize that the names don't match.

If you are using arrays in your userform code, then this is another place to
look.

--
Regards,
Tom Ogilvy


"Craig" wrote in message
oups.com...
ok, i've got a workbook that i've just added a user form to, everything
works fine for a while, then, seemingly at random i start getting error
9 subscript out of range messages when trying to show the form. i'm
still working on the programming of the form itself, but none of the
programming in the main module changes from when it works to when it
starts giving the errors. is it possible that the changes i'm making
in the form code is causing the error. and does anyone have any idea
how i could fix this? the code for launching the form, which is what
keeps coming up highlighted when you click on debug is

Sub opentimesheetform()
TimeSheetForm.Show
End Sub

with the TimeSheetForm.Show line being highlighted. I can put more of
the code up if that would help.