Results 1 to 6 of 6

Copy formulas not values

Threaded View

  1. #1
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Copy formulas not values

    Hi guys,

    There are plenty of google hits for people copy-pasting in VBA but actually wanting 'paste special as values'; my problem is the opposite and I'm totally flummoxed.
    This:
    Sub New_Lines()
        Dim iLRow As Integer
        Application.EnableEvents = False
            Columns.Hidden = False
            Cells.AutoFilter
            iLRow = Range("A1").End(xlDown).Row
            Range("querytable").AutoFilter 1, "QXY"
            Range(Rows(2), Rows(2).End(xlDown)).Copy Cells(iLRow + 1, 1)
            Range(Cells(iLRow + 1, 1), Cells(Rows.Count, 1)).Replace "QXY", "QXY revised", xlWhole
        Application.EnableEvents = True
    End Sub
    is meant to filter my raw data table, duplicate a certain set (QXY) and 'rename' them (as QXY revised) so that I can see how adjustments to the data would look without losing the original.

    But sometimes the copy command pastes values (this afternoon, for example) and sometimes formulae. (I definitely need the formulae). I'm probably being a total div, but I can't work out for the life of me what the cause is.

    My last resort is simply to break the copy over two lines and paste special 'all' - but I know this is a weak man's workaround and I'd like to know the cause for the sake of predictability/manageability.

    Any help gratefully received.

    CC

    PS - on further inspection, it would seem the "default paste is as values" is not limited to the VBA - I also lose the formulae if I copy/paste manually. So perhaps my question should be "why is my copy/paste broken?"
    Last edited by Cheeky Charlie; 03-25-2009 at 01:12 PM. Reason: PS

Thread Information

Users Browsing this Thread

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

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