×
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

Formatting Problems

Formatting Problems

Formatting Problems

(OP)
Maybe someone can help....

I have created a simple macro that copies a worksheet (in the same workbook)and inserts a new worksheet.  However, the format is totally different.  The copied worksheet is landscape, but when it copies and inserts, it changes the column(s) dims as well as portrait.  Also paste what ever you filled out on the original worksheet.  So I just need a few tips on how to eliminate the data after it is copied and how to fix the format problem I am having.

Macro for copying the worksheet:

Private Sub CommandButton1_Click()

 ' IF YOU REQUIRE ADDITIONAL PAGE OF "MMD"
 

 Sheets.Add
 Sheets("MMD").Select
    Cells.Select
    Selection.Copy
    Sheets("Sheet30").Select
    ActiveSheet.Paste
    
End Sub

Thanks a bunch

RE: Formatting Problems

(OP)
Oh, one more thing,,, this is all under a command button that I created!  

RE: Formatting Problems

Try this:

CODE

Private Sub CommandButton1_Click()

 ' IF YOU REQUIRE ADDITIONAL PAGE OF "MMD"
 

 Sheets.Add
 Sheets("MMD").Select
    Cells.Select
    Selection.Copy
    Sheets("Sheet30").Select
    ActiveSheet.Paste xlPasteAll
    Application.CutCopyMode = False
    
End Sub

RE: Formatting Problems

(OP)
Thanks for the reply and it seems not to like the ActiveSheet.Paste x1pasteAll input.

However, I did create a keyboard shortcut formatting and it seemed to work...

Again, many thanks

RE: Formatting Problems

That's not x1pasteAll but xlpasteAll where xl is short for Excel.

Cheers,
Joerd

Please see FAQ731-376: Eng-Tips.com Forum Policies 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