Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 5 of 5

Thread: Macro

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Milwaukee, WI
    Posts
    105
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #3
    Board Regular
    Join Date
    Mar 2002
    Location
    Milwaukee, WI
    Posts
    105
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #4
    New Member
    Join Date
    Apr 2002
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #5
    Board Regular
    Join Date
    May 2002
    Posts
    147
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •