Problem adding multiple worksheets

  • Thread starter Thread starter pokdbz
  • Start date Start date
P

pokdbz

I'm using this to add mulitple work sheets

Set ws = Worksheets.Add
ws.Name = sheetName ' error line

I am pulling sheetName from another worksheet and am getting an error when
it goes to make the 3rd worksheet.

The error message:
Runtime error '1004'
Application defined or object defined error

I'm not sure what the problem is since it makes two worksheets fine and
fails on the third.

These are the worksheet names it creates in this order.
AJ SILBERMAN & CO
AMCON DISTRIBUTING CO - OMAHA
AMCON DISTRIBUTING - SPRINGFIELD
 
Your last worksheet name, AMCON DISTRIBUTING - SPRINGFIELD, is one character
beyond the tab name maximumn of 31 characters.

Try abbreviating it to AMCON DISTRIB - SPRINGFIELD or something along those
lines.
 
Great thanks

Kevin B said:
Your last worksheet name, AMCON DISTRIBUTING - SPRINGFIELD, is one character
beyond the tab name maximumn of 31 characters.

Try abbreviating it to AMCON DISTRIB - SPRINGFIELD or something along those
lines.
 
Back
Top