+ Reply to Thread
Results 1 to 4 of 4

Copy range to new workbook w/some cells as values & some cells as formulas in new workbook

  1. #1
    Registered User
    Join Date
    08-12-2013
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Copy range to new workbook w/some cells as values & some cells as formulas in new workbook

    Hello, I am a beginning VBA user and this is my first post in this forum. I am copying a range from a worksheet into a new workbook, and then sending the new workbook as an email attachment. The email part works okay, but I need assistance on the copy portion.

    In my old worksheet I have some formulas in my range that I am copying, and I want to paste some of the formulas as "values" into my new workbook, but I also want to paste certain formulas as "formulas" into the new workbook. So far I can only get my macro to copy values OR formulas.

    Also, my new workbook is not keeping my page setup (one page) from my old workbook; it is creating 4 pages. I've searched for a solution but have not found an answer to fix this. I want the manager to open the attachment and view/print only one page without having to adjust the page setup themselves.

    Here is the code and I also attached my workbook (I found this code in the book "101 Ready to Use Excel Macros" by M.Alexander & J.Walkenbach):

    Please Login or Register  to view this content.
    Last edited by happydayze; 08-15-2013 at 07:03 PM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Copy range to new workbook w/some cells as values & some cells as formulas in new work

    Try this. Put the code in a standard code module (e.g.; Module2) and assign the macro button to this code. Delete your duplicate code in the ThisWorkbook code module.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    08-12-2013
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Copy range to new workbook w/some cells as values & some cells as formulas in new work

    Dear Alpha,

    Thank you! Thank you! It works perfectly! This will help me tremendously as I will have over 170 records to perform this macro on. I really appreciate your help and expertise.

    Happy

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Copy range to new workbook w/some cells as values & some cells as formulas in new work

    You're welcome. Mark this thread as solved.

    Also, add this line to delete the button from the worksheet copy.
    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 08-14-2013 at 12:50 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Copy range of cells of one workbook, to another workbook.
    By hulstronics in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-09-2012, 10:35 PM
  2. Copy Cells and Formulas from One Workbook to Another
    By Vladamir in forum Excel General
    Replies: 2
    Last Post: 09-11-2012, 11:42 AM
  3. [SOLVED] Copy different cells (no range) in another workbook
    By audax48 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-25-2012, 09:36 PM
  4. Copy range of cells from one workbook to another.
    By kishoremcp in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-26-2012, 04:34 AM
  5. Copy a range of cells to another workbook
    By Dobbie in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-17-2010, 04:03 PM

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