Results 1 to 5 of 5

Excel VBA is pasting formulas and not values

Threaded View

  1. #1
    Registered User
    Join Date
    04-02-2019
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    74

    Excel VBA is pasting formulas and not values

    This is probably a simple fix but I can't seem to crack it...the code below is pasting formulas rather than values. The copy/paste is near the bottom in the "desWS.Range" statements.

    Sub Calculate()
    
    'Dim t1 As Double, t2 As Double
    't1 = Timer
    '    Application.ScreenUpdating = False
        Application.Calculate
    '    Application.ScreenUpdating = True
    '
    't2 = Timer
    'msg = MsgBox("Done; " & Round(t2 - t1, 0) & " seconds elapsed.", vbOKOnly, "Goal Seek Complete")
    msg = MsgBox("Calculation complete. See Outputs tabs and Project Model for results.")
    
    Dim desWB As Workbook, desWS As Worksheet, srcWS As Worksheet
        Set srcWS = ThisWorkbook.Sheets("Detailed Outputs")
        Set desWB = Workbooks.Open(Environ("userprofile") & "\Desktop\Model_Template.xlsx")
        Set desWS = Sheets("Input")
        With srcWS
            .Range("B8:M8").Copy desWS.Range("Q4")
            .Range("B45:M45 ").Copy desWS.Range("Q8")
            Application.ScreenUpdating = True
    
    
    End With
    End Sub
    Last edited by YukonSoDank; 04-09-2019 at 08:53 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. pasting formulas as values with multiple selections
    By esbencito in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-24-2018, 12:14 AM
  2. [SOLVED] RunTime error 438 on adding formulas and pasting them as values.
    By PaulM100 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-29-2018, 07:29 AM
  3. Code is pasting formulas instead of values - Please help
    By ByronHopf in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-10-2014, 08:25 PM
  4. [SOLVED] Macro Pasting Values Instead of Formulas
    By bryanmarks in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 05-07-2014, 10:26 AM
  5. Excel crashing when Pasting Formulas as Values
    By XOR LX in forum Excel General
    Replies: 1
    Last Post: 11-08-2013, 11:48 AM
  6. pasting values instead of formulas
    By fabrecass in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-06-2013, 08:22 AM
  7. Pasting Values with Formulas???
    By mccormij in forum Excel General
    Replies: 2
    Last Post: 04-10-2007, 07:05 AM

Tags for this Thread

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