Macro

JMercer

New Member
Joined
Apr 23, 2002
Messages
4
I am wishing to create a Macro to COPY a range of cells from sheet1 to sheet2. But, each time I hit the Macro(button). copy's to the next empty cell on down sheet2. So sheet1 cell range stays blank after hitting the Macro and sheet2 is a log. (like a fill in the blank on sheet 1)
This message was edited by jmercer on 2002-05-07 09:13
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Hit Alt+F11 to view the VBA code.

it should look something like this:
Sheets("Sheet1").Range("A1:A10").Copy
Sheets("Sheet2").Range("A1:A10").PasteSpecial xlPasteAll

You can change the ranges and sheet names to whatever you need.

hth
 
Upvote 0
Just to make sure it works, here's the whole of the code:

Sub CopySheetToSheet()
Sheets("Sheet1").Range("A1:A10").Copy
Sheets("Sheet2").Range("A1:A10").PasteSpecial x1PasteAll
End Sub
 
Upvote 0
Sorry but I can't get this to work but it does not look like I would be able reuse the
cells. And, it would log on the next empty row down
 
Upvote 0
try this:

ActiveCell.Range("A1:A10").Select
Selection.Copy
ActiveSheet.Next.Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlValues
Range("A1").Select
Application.CutCopyMode = False

This will also copy from sheet 2 to sheet 3
 
Upvote 0

Forum statistics

Threads
1,213,526
Messages
6,114,136
Members
448,551
Latest member
Sienna de Souza

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top