![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 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 ] |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: Boston, MA
Posts: 105
|
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 |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Location: Boston, MA
Posts: 105
|
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 |
|
|
|
|
|
#4 |
|
New Member
Join Date: Apr 2002
Posts: 4
|
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 |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: May 2002
Posts: 88
|
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 |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|