ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Use a button to copy the values of one range to another (https://www.excelbanter.com/excel-programming/365582-use-button-copy-values-one-range-another.html)

SuitedAces[_2_]

Use a button to copy the values of one range to another
 

Please give me some help with this

I have a range on Sheet1 and a range of the same dimension on
Sheet2 . I need code for a button on Sheet1 that when pressed copies
the values of the range on Sheet2 into the range on Sheet1

THANK You


--
SuitedAces
------------------------------------------------------------------------
SuitedAces's Profile: http://www.excelforum.com/member.php...o&userid=35840
View this thread: http://www.excelforum.com/showthread...hreadid=556302


Norman Jones

Use a button to copy the values of one range to another
 
Hi SuitedAccess,

Try:
'=============
Public Sub Tester()
Dim rng1 As Range
Dim rng2 As Range

With ThisWorkbook
Set rng1 = .Sheets("Sheet1").Range("A1:D10") '<<== CHANGE
Set rng2 = .Sheets("Sheet2").Range("C1:F10") '<<== CHANGE
End With

rng1.Copy Destination:=rng2

End Sub
'<<=============


---
Regards,
Norman



"SuitedAces" wrote
in message ...

Please give me some help with this

I have a range on Sheet1 and a range of the same dimension on
Sheet2 . I need code for a button on Sheet1 that when pressed copies
the values of the range on Sheet2 into the range on Sheet1

THANK You


--
SuitedAces
------------------------------------------------------------------------
SuitedAces's Profile:
http://www.excelforum.com/member.php...o&userid=35840
View this thread: http://www.excelforum.com/showthread...hreadid=556302




Paul B

Use a button to copy the values of one range to another
 
SuitesdAces, something like this,

Sheet1.Range("A1:A20").Value= Sheet2.Range("A1:A20").Value

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"SuitedAces" wrote
in message ...

Please give me some help with this

I have a range on Sheet1 and a range of the same dimension on
Sheet2 . I need code for a button on Sheet1 that when pressed copies
the values of the range on Sheet2 into the range on Sheet1

THANK You


--
SuitedAces
------------------------------------------------------------------------
SuitedAces's Profile:

http://www.excelforum.com/member.php...o&userid=35840
View this thread: http://www.excelforum.com/showthread...hreadid=556302




SuitedAces[_3_]

Use a button to copy the values of one range to another
 

Gentlemen

I have tested both methods with success !

Thank you both very much.


--
SuitedAces
------------------------------------------------------------------------
SuitedAces's Profile: http://www.excelforum.com/member.php...o&userid=35840
View this thread: http://www.excelforum.com/showthread...hreadid=556302



All times are GMT +1. The time now is 10:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com