+ Reply to Thread
Results 1 to 2 of 2

Copy and Paste Formula: Bypassing the Clipboard

Hybrid View

  1. #1
    Registered User
    Join Date
    08-14-2012
    Location
    AU
    MS-Off Ver
    Excel 2003
    Posts
    3

    Copy and Paste Formula: Bypassing the Clipboard

    Hi All,

    I'm trying to copy formulas (with formulas in A1:A5) into a new cell range. The code is not executing? What am i doing wrong??? Thanks.

    Sub CopyFormula(rngSource As Range, rngTarget As Range)
      
         rngTarget.Resize(rngSource.Rows.Count, rngSource.Columns.Count).Formula = rngSource.Formula
        
    End Sub
     
    Sub UpdateCopyFormula()
     
        Sheet1.Activate
         Call CopyFormula(Sheet1.Range("A1:A5"), Sheet1.Range("B1"))
         
    End Sub

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Copy and Paste Formula: Bypassing the Clipboard

    Sub UpdateCopyFormula()
         Sheets("Sheet1").Activate
         Call CopyFormula(Range("A1:A5"), Range("B1"))
    End Sub
    If solved remember to mark Thread as solved

+ 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