+ Reply to Thread
Results 1 to 4 of 4

Offset TotalsRowRange at start but not end

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    09-17-2014
    Location
    UK
    MS-Off Ver
    2007
    Posts
    117

    Offset TotalsRowRange at start but not end

    I'm using VBA to populate a chart in excel and the a range I need is the header row of a data table.

    I don't want the first four columns so I have used the following:

    Set headrow = ActiveSheet.ListObjects("byteam").HeaderRowRange.Offset(0, 4)
    The problem is that it also extends the range four cells to the right of the end of the header row. How can I keep the end of the range as the end of the header row?

    Thanks in advance...

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Offset TotalsRowRange at start but not end

    Perhaps this:-
    Dim headrow As Range
    With ActiveSheet.ListObjects("byteam")
        Set headrow = .HeaderRowRange(5).Resize(, .HeaderRowRange.Count - 5)
    End With

  3. #3
    Forum Contributor
    Join Date
    09-17-2014
    Location
    UK
    MS-Off Ver
    2007
    Posts
    117

    Re: Offset TotalsRowRange at start but not end

    Cheers for that - it works perfectly.

    This really helps me out with the way the source data is structured as I will often need to offset the start of the range but not the end.

    Thanks again!

  4. #4
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Offset TotalsRowRange at start but not end

    You're welcome

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] find cells with values that fall between dynamic start and end value, color offset (-1,0)
    By ThaGonz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-15-2014, 11:56 PM
  2. [SOLVED] Offset/Match? Chart by selected start/end date and col header
    By Steve N. in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 07-12-2013, 02:06 PM
  3. offset data series doesn't take zero at the start
    By seatejo in forum Excel Charting & Pivots
    Replies: 8
    Last Post: 04-17-2013, 03:13 AM
  4. Replies: 4
    Last Post: 04-09-2013, 09:44 PM
  5. Offset (start after last row of previous procedure)-Merging macros
    By Mslady in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-21-2005, 09:47 AM

Tags for this Thread

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