Thread: vb "400" error
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default vb "400" error

If that code is in a sheet module move it to a general module - the kind you
get when you go to the VBE and do Insert = Module

In a sheet module you can to to the top of the module and in the left
dropdown select worksheet (for example) and in the right one of its events.

That is the only type of code I would put in a sheet module.

Hopefully your declaration of private won't cause scope/visibility
problems. Don't know what is calling what from where.

--
Regards,
Tom Ogilvy

"Gixxer_J_97" wrote in message
...
Thank you. Why that worked, I'm still not sure. I've used the code I had
before and no problems. That got rid of the error - howeveri have the

same
error (the red circle with an X and only the 400) popping up on the
following, after it executes the

Cells(Cells.Rows.Count, 4).End(xlUp)(2).Select:

<BEGIN VB CODE
Private Sub AddToSalesJournal()

Sheets("sales journal").Select
Cells(Cells.Rows.Count, 4).End(xlUp)(2).Select

End Sub
<END VB CODE

the next line that is excecuted after this sub exits is

MsgBox "Order # " & workOrderNumber & " for " & customerName & " added
successfully."

and the code is done running (or should be).