+ Reply to Thread
Results 1 to 2 of 2

Adding in a "header" copy to existing macro

  1. #1
    Registered User
    Join Date
    08-11-2008
    Location
    Hull, England
    Posts
    1

    Adding in a "header" copy to existing macro

    Hello All

    First post here, be nice to me! I'm a very basic user of VB - most of what I know is learned through browsing forums and the macro recorder. I have a macro code to sort my spreadsheet then copy data, create a new worksheet, paste the copied data and save and close. I didn't come up with this macro alone, hence why I am stuck when it comes to adding to it. Here is the chunk of code I need to amend :

    Please Login or Register  to view this content.
    As you can see this doesn't copy the header of the worksheet over to each new worksheet it adds. Ideally I would like it to copy the header over, and the formatting of the cells too so numbers appear with decimal places etc. I have tried doing it myself with the macro recorder but haven't worked it out as yet. If anyone can help out I would be extremely grateful,

    Thanks!
    Matt

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi Matt, and welcome to the forum.

    I'm assuming your header is on a single row. First name your header range "header"

    Now at the top of your procedure add the following two lines

    Please Login or Register  to view this content.
    now immediately before the Workbooks.Add line add

    Please Login or Register  to view this content.
    and immediately after the Workbooks.Add line

    Please Login or Register  to view this content.
    HTH

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1