Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Sep 2001
    Location
    Birmingham, Alabama, USA
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Copy a column in a Macro (2003)

    I am trying to do something in a Macro that is easy to do in spreadsheet but I can

  2. #2
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Copy a column in a Macro (2003)

    Hi mmckissock

    Press Alt+F11Create a new Module and paste this code into it:

    Sub Counter()
    Dim RowCount as Double
    Dim ValueA
    Dim ValueB
    Dim TheValue
    Dim List as Double


    'This Counts the Number of Rows in the Spreadsheet
    RowCount = Range("A65535").End(xlUp).Row

    Range("A2").Select

    For List=1 to RowCount

    ValueA= ActiveCell.Value

    Activecell.Offset(0,2).select

    ValueB=ActiveCell.Value

    TheValue=ValueA+ValueB

    Activecell.offset(0,1).select

    ActiveCell.Value=The Value

    ActiveCell.Offset(1,-3).select

    Next List

    End Sub

    It works for the example you gave me.

    Good Luck Jerry
    Jerry

  3. #3
    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: Copy a column in a Macro (2003)

    You can use an "autofill routine" like listed in <post#=332972>post 332972</post#>

    Steve

  4. #4
    Lounger
    Join Date
    Sep 2001
    Location
    Birmingham, Alabama, USA
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy a column in a Macro (2003)

    Many Thanks!!
    Both routines work. The Autofill is much faster and works out much better in my sheet.
    I can

Posting Permissions

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