Dave Hawley Wizard of Oz

  • Member since Jan 24th 2003
  • Last Activity:
Posts
32,090
Reactions Received
4
Points
188,694
Profile Hits
22,709
  • Hi,

    in this code, i would like the data to paste in Values Format .this code copy formulas on destination sheet. i want to copy only values not formula. Could you please help me on this.

    Thanks in advance


    Sub CopySelectedRows()

    Dim rCopy As Range

    Dim lAreas As Long


    On Error Resume Next

    Set rCopy = Application.InputBox("Select Rows to copy. " _

    & "Use Ctrl for non-contiguous rows", "COPY ROWS", Selection.Address, , , , , 8)

    On Error GoTo 0

    If rCopy Is Nothing Then Exit Sub 'Hit Cancel


    If rCopy.Columns.Count <> Columns.Count Then

    MsgBox "Please select entire row(s)"

    Run "CopySelectedRows"

    Else

    For lAreas = 1 To rCopy.Areas.Count

    rCopy.Areas(lAreas).Copy Sheet18.Cells(Rows.Count, 1).End(xlUp)(2, 1)


    Next lAreas

    End If