4

I want to copy a cell from one worksheet and paste the value into the first blank cell in a range of cells on another worksheet.

I found some code that almost works but it pastes the formatting and formula.

Sub dural()
    Dim r1 As Range, r2 As Range
    Set r1 = Sheets("GHIN").Range("D151")
    Set r2 = Sheets("Monthly").Range("I56").End(xlUp).Offset(1, 0)
    r1.Copy r2
End Sub

This works except I want it to paste special values only.

2
  • 10
    change r1.Copy r2 to r2 = r1 Apr 1, 2019 at 18:42
  • Thank You! This worked perfectly!
    – CDiemert
    Apr 1, 2019 at 18:52

2 Answers 2

0

Sheets("Monthly").Range("I56").End(xlUp).Offset(1, 0) = Sheets("GHIN").Range("D151").Value

1
  • add context. (From Review).
    – ZF007
    Aug 1, 2019 at 8:38
0

Try the code bellow.

Sub dural()
    Dim r1 As Range, r2 As Range
    Set r1 = Sheets("GHIN").Range("D151")
    Set r2 = Sheets("Monthly").Range("I56").End(xlUp).Offset(1, 0)

    '//Copy r1 (cell format, value...)
    r1.Copy

    '//Paste special in the desired cell. You can add/change parameters if you want
    r2.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End Sub

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.