Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
What about: '---------------------------------------- Private Sub CommandButton1_Click() Dim rw As Long Dim rgO as range, rgD as range 'origin and dest ranges rw = Range("T5").Value set rgO= Worksheets("Adj. Savings").Range("B1") set rgD = Worksheets("Savings History").Range("B" & rw) rgO.Copy rgD.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _ SkipBlanks :=False, Transpose:=False ' ... End Sub '------------------------------------- -- Regards, Sébastien <http://www.ondemandanalysis.com "Matto" wrote: I get an error on this code when it trys to select the new cell reference, can someone help me refer to the cell correctly? Thanks. Private Sub CommandButton1_Click() Dim rw As Long rw = Range("T5").Value Sheets("Adj. Savings").Select Worksheets("Adj. Savings").Range("B1").Copy Worksheets("Savings History").Range("B" & rw).Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I copy a value from a cell and paste it into another cell while adding it to the previous value in that cell | Excel Worksheet Functions | |||
Copy/Paste from once cell to another | Excel Worksheet Functions | |||
Select cell, Copy it, Paste it, Return to Previous cell | Excel Discussion (Misc queries) | |||
Copy and Paste macro needs to paste to a changing cell reference | Excel Programming | |||
how to copy and paste cell as a value. | Excel Programming |