+ Reply to Thread
Results 1 to 3 of 3

Macro problem

  1. #1
    Jim
    Guest

    Macro problem

    Sub Macro1()
    '
    ' Macro1 Macro
    ' Macro recorded 3/16/2005 by jim
    '

    '
    Range("B9").Select
    Selection.Cut
    Range("F8").Select
    ActiveSheet.Paste
    Range("F10").Select
    End Sub


    Hello
    How do I get this macro to start where it stops?
    I want it to cut cell B9 then paste it to cell F8 then move to cell F10,
    this works over & over.
    I need this macro to cut a cell then move up one row & to the right 4
    columns and paste then move back to where it started then move down 2 rows.

    Thank You

















  2. #2
    Don Guillett
    Guest

    Re: Macro problem

    Both below require NO selections

    something like
    for each c in range("b9:b" & cells(rows.count,"b").end(xlup).row)
    c.copy c.offset(-1,4)
    next

    or for every other row this might work

    for i= 1 to cells(rows.count,"a").end(xlup).row step 2
    cells(i,"a").copy cells(i-1,"f")
    next i

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "Jim" <[email protected]> wrote in message
    news:[email protected]...
    > Sub Macro1()
    > '
    > ' Macro1 Macro
    > ' Macro recorded 3/16/2005 by jim
    > '
    >
    > '
    > Range("B9").Select
    > Selection.Cut
    > Range("F8").Select
    > ActiveSheet.Paste
    > Range("F10").Select
    > End Sub
    >
    >
    > Hello
    > How do I get this macro to start where it stops?
    > I want it to cut cell B9 then paste it to cell F8 then move to cell F10,
    > this works over & over.
    > I need this macro to cut a cell then move up one row & to the right 4
    > columns and paste then move back to where it started then move down 2

    rows.
    >
    > Thank You
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >




  3. #3
    Gord Dibben
    Guest

    Re: Macro problem

    Jim

    Try recording the macro with the "Relatiuve Reference" button enabled.

    You will get different code like this.

    Sub Macro1()
    '
    ' Macro1 Macro
    ' Macro recorded 3/16/2005 by Gord Dibben
    '

    '
    ActiveCell.Offset(3, 3).Range("A1").Select
    Selection.Cut
    ActiveCell.Offset(0, 3).Range("A1").Select
    ActiveSheet.Paste

    End Sub

    Note: you don't have to select things to work on them.

    Range(Range("A1"), Range("A1").End(xlDown)).Select
    Selection.Copy
    Sheets("Sheet2").Select
    Range("A1").Select
    Selection.Paste

    is equal to.....

    Range(Range("A1"), Range("A1").End(xlDown)).Copy _
    Destination:=Sheets("Sheet2").Range("A1")


    Gord Dibben Excel MVP


    On Wed, 16 Mar 2005 10:14:46 -0700, "Jim" <[email protected]> wrote:

    >Sub Macro1()
    >'
    >' Macro1 Macro
    >' Macro recorded 3/16/2005 by jim
    >'
    >
    >'
    > Range("B9").Select
    > Selection.Cut
    > Range("F8").Select
    > ActiveSheet.Paste
    > Range("F10").Select
    >End Sub
    >
    >
    >Hello
    >How do I get this macro to start where it stops?
    >I want it to cut cell B9 then paste it to cell F8 then move to cell F10,
    >this works over & over.
    >I need this macro to cut a cell then move up one row & to the right 4
    >columns and paste then move back to where it started then move down 2 rows.
    >
    >Thank You
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1