LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Copy and Paste Cell

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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
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 [email protected] Excel Worksheet Functions 2 November 7th 07 09:39 AM
Copy/Paste from once cell to another ebraun01 Excel Worksheet Functions 7 January 27th 06 09:30 PM
Select cell, Copy it, Paste it, Return to Previous cell spydor Excel Discussion (Misc queries) 1 December 30th 05 01:29 PM
Copy and Paste macro needs to paste to a changing cell reference loulou Excel Programming 0 February 24th 05 10:29 AM
how to copy and paste cell as a value. shital Excel Programming 1 October 3rd 03 02:06 PM


All times are GMT +1. The time now is 03:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"