using macro to copy paste

R

ramzi

hi....

I would like to copy my data at location A1:A4 sheet 1 and past at A1:A4
at sheet 2 without open sheet 2.
Can anyone help me on this..

rgds
 
S

Stefi

Range("A1:A4").Copy Destination:=Sheets("Sheet2").Range("A1")

Regards,
Stefi

„ramzi†ezt írta:
 
C

Chris Bode via OfficeKB.com

Please follow following steps
1. add control toolbox to the toolbar (toolbar>rightclick>control toolbox)
2.add a command button on worksheet 1
3.Right click command button>view code
4.then add following code in the code window:-

Private Sub CommandButton1_Click()
dim i as integer
For i=1 To 4
Application.Worksheets("sheet2").Cells(i, 1).Value= Application.
Worksheets("sheet1").Cells(i, 1).Value
next
End Sub

Now You got it!

Have a happy time.....




Chris
------
Convert your Excel spreadsheet into online calculator.
http://www.spreadsheetconverter.com

--
Chris
------
Convert your Excel spreadsheet into online calculator.
http://www.spreadsheetconverter.com

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/ms-excel/200901/1
 
Top