Results 1 to 2 of 2

selecting range with macro

Threaded View

  1. #1
    Registered User
    Join Date
    03-19-2013
    Location
    america
    MS-Off Ver
    Excel 2003
    Posts
    1

    selecting range with macro

    i am using the following to total a work sheet, however i cannot figure how to select just certain columns.
    the spreadsheet has a-l but i just want totals for g-l
    thanks

    Sub sumtotal()
        With ActiveSheet.Range("G:L").CurrentRegion
            If .Cells(.Rows.Count, 1).Value <> "Total" Then
                With .Offset(.Rows.Count).Resize(1)
                    .Formula = "=sum(r2c7:r[-1]c)"
                    .Columns(1).Value = "Total"
                End With
            End If
        End With
    End Sub
    Last edited by JBeaucaire; 03-27-2013 at 02:02 AM. Reason: Added CODE tags. Please read the Forum Rules, link above in the menu bar.

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