×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

AutoNew Excel Macro Help Requested

AutoNew Excel Macro Help Requested

AutoNew Excel Macro Help Requested

(OP)
Probably a pretty simple request, but I have spent hours crashing excel macros with no luck....

I am trying to create a macro that will format a tab (borders, shading, some text and formulas) when it is created.  I have created a 'sample' tab that contains the exact format I would like for the new tabs.  I thought I could have the new tab go to the sample tab, copy it all and paste it on the new tab.  However, the macro seems to crash because it keeps looking for a specific sheet name (like sheet2 or sheet 3) and as I create new tabs these numbers increment (the sample tab name seems fine as its name stays the same).  

Should I be using the AutoNew function?  If so, how do I handle the moving between tabs to grab the data and then come back to the new tab, when the name of the new tab will constantly be incrementing.

Any help is MUCH appreciated!!! Thx!

RE: AutoNew Excel Macro Help Requested

In your macro, create a new tab, name it and then do the copying from your preset tab. You can then rename the tab after copying.

Hope this is of some use.

maybe only a drafter
but the best user here!

RE: AutoNew Excel Macro Help Requested

Hello again,

Another simpler option would be just to copy the entire tab, will this not be good enough?

maybe only a drafter
but the best user here!

RE: AutoNew Excel Macro Help Requested

You can also save your sample worksheet as a template (*.xlt), which should be stored (automatically) in your user templates directory. If you then right click on a sheet tab, and then choose Insert..., Excel should present you with all available templates.

Cheers,
Joerd

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources