Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jan 2003
    Location
    Dallas, Texas
    Posts
    139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Writing a Macro in Excel (2000)

    I just spent two days doing something I should have been able to at least speed up with a Macro. I attempted to record a macro that would automate a repetative Copy, Paste, Bold procedure. The recorded macro named the cells that I copied and would always go back to that row.
    What I needed was to copy 8 cells to the right of the current cursor position, move down one row, paste, then Bold.
    It's too late to help this time, but how could I have written that? Assuming that I could.

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Writing a Macro in Excel (2000)

    How about this:

    <pre>Sub LadyGnomeMacro()
    Range(ActiveCell.Offset(0, 1), ActiveCell.Offset(0, 8)).Copy
    ActiveCell.Offset(1, 1).PasteSpecial
    Selection.Font.Bold = True
    Selection.Range("a1").Offset(-1, -1).Select
    End Sub</pre>


    Steve

  3. #3
    2 Star Lounger
    Join Date
    Jan 2003
    Location
    Dallas, Texas
    Posts
    139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Writing a Macro in Excel (2000)

    Hooyah!!!
    You rock! <img src=/S/basket.gif border=0 alt=basket width=58 height=52>
    I changed it just a bit.

    Sub LadyGnomeMacro()
    Range(ActiveCell.Offset(0, 0), ActiveCell.Offset(0, 8)).Copy
    ActiveCell.Offset(1, 0).PasteSpecial
    Selection.Font.Bold = True

    End Sub
    and it does exactly what I want. Next time, it will not take two days!!
    Thanks so much.

Posting Permissions

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