+ Reply to Thread
Results 1 to 5 of 5

Paste Formulas With VBA

  1. #1
    Forum Contributor
    Join Date
    12-28-2015
    Location
    US
    MS-Off Ver
    365
    Posts
    133

    Paste Formulas With VBA

    I am trying to paste formulas. The below is a snippet of my code. What part of line 3 and the ".copy" should I change?




    Line 1:With .AutoFilter.Range
    Line 2: Set ws = Worksheets.Add(After:=Worksheets(Worksheets.Count))
    Line 3: .Resize(, .Columns.Count - 1).Copy ws.Range("A1")

    Thanks!

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Paste Formulas With VBA

    You don't have to change anything to paste formulas, if .AutoFilter.Range contains formulas. We can provide more help if you attach your file.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    12-28-2015
    Location
    US
    MS-Off Ver
    365
    Posts
    133

    Re: Paste Formulas With VBA

    Please see sample attached. Yes, I thought the range having the formulas would carry over, but they're not. Feel free to look around the macros are STEP1 and STEP2.
    Attached Files Attached Files

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Paste Formulas With VBA

    I find it strange that your code does not work as is. I do not know why

    =1+1

    is pasted as

    2

    But for a fix, replace Line 3 (from your first post) with this:

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    12-28-2015
    Location
    US
    MS-Off Ver
    365
    Posts
    133

    Re: Paste Formulas With VBA

    works perfectly.

    Thank You!

+ 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. Paste certain formulas as formulas and others as values to a new workbook
    By fokk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-03-2017, 12:07 PM
  2. Replies: 6
    Last Post: 10-12-2016, 09:34 AM
  3. Replies: 9
    Last Post: 12-04-2015, 05:19 PM
  4. Copy Formulas and Paste into the Last Set # of Rows Only & Paste Values
    By Mr. Ice in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-23-2014, 07:48 AM
  5. [SOLVED] copy and paste formulas keeping formulas
    By Daza in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-05-2014, 01:59 AM
  6. [SOLVED] Changing Current Code from Paste Formulas to Paste Values
    By freybe06 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-24-2013, 12:33 PM
  7. [SOLVED] Macro to paste formulas then paste values
    By deanstein in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-19-2013, 11:30 AM

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