Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2011
    Posts
    4

    Unanswered: Macro copies formulas instead of values.

    I have the following macro and it works but it copies the formula instead of the values.

    I need help in editing the macro--I have researched this problem and the solution is PasteSpecial but I do not know how to incorporate into this code??

    Here is the macro:

    Sub RowCopy()
    Dim rngFind As Range

    With Worksheets("Summary").UsedRange
    Set rngFind = .Find("Totals", _
    LookIn:=xlValues, _
    LookAt:=xlWhole, _
    SearchOrder:=xlByRows, _
    SearchDirection:=xlNext, _
    MatchCase:=True)
    End With
    rngFind.EntireRow.Copy _
    Destination:=Worksheets("Sheet3").Range("A1")
    End Sub

  2. #2
    Join Date
    Sep 2008
    Location
    London, UK
    Posts
    511
    Welcome to the forum.

    Try this:
    Code:
    Sub RowCopy()
        
        Dim rngFind As Range
        
        Set rngFind = Worksheets("Summary").UsedRange.Find( _
                                What:="Totals", _
                                LookIn:=xlValues, _
                                LookAt:=xlWhole, _
                                SearchOrder:=xlByRows, _
                                SearchDirection:=xlNext, _
                                MatchCase:=True)
        
        If Not rngFind Is Nothing Then
            Worksheets("Sheet3").Range("A1").EntireRow.Value = rngFind.EntireRow.Value
        End If
        
    End Sub

  3. #3
    Join Date
    Sep 2011
    Posts
    4

    Solved

    Hi Colin

    That worked great. Thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •