+ Reply to Thread
Results 1 to 4 of 4

Selecting Cells Each Side of a Selected Cell

Hybrid View

  1. #1
    Registered User
    Join Date
    02-13-2014
    Location
    Weymouth, England
    MS-Off Ver
    Excel 2010
    Posts
    2

    Selecting Cells Each Side of a Selected Cell

    I have a column of values D1:D200.
    Using this =CELL("address",INDEX(D1:D200,MATCH(MAX(D1:D200),D1:D200,0))) it displays the cell with the largest value in.
    I have been trying to using VBA to select the 10 cells above and below the displayed CELL reference and so far I have failed. The largest value will always be somewhere in the centre of the column of values (between D50 and D150). I am looking to chart the trends leading up to and passed the largest value. I have been trying Range and Cells with no success so any help would be very appreciated.

  2. #2
    Forum Contributor
    Join Date
    11-13-2013
    Location
    United States
    MS-Off Ver
    2010
    Posts
    147

    Re: Selecting Cells Each Side of a Selected Cell

    Hi Targetpin,

    Welcome to the Forum.

    I am sure there are a couple of ways to select the cells you want. Here is the one that came up with

    ActiveCell.Offset(-10).Resize(21).Select
    This will offset 10 rows above the ActiveCell (or you can replace ActiveCell with your cell reference), and it "resizes" the selection to 21 rows (10 above + 10 below + the cell with largest value).

    Hope this helps.
    ----
    Mark threads as Solved
    Star those that help

  3. #3
    Registered User
    Join Date
    02-13-2014
    Location
    Weymouth, England
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Selecting Cells Each Side of a Selected Cell

    Thank you Steve. The sheet now works realy well.

    Mark

  4. #4
    Forum Contributor
    Join Date
    11-13-2013
    Location
    United States
    MS-Off Ver
    2010
    Posts
    147

    Re: Selecting Cells Each Side of a Selected Cell

    Glad it worked for you.

    Don't forget to mark the thread Solved.

+ 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. Replies: 1
    Last Post: 05-12-2012, 12:08 PM
  2. Selecting rows of selected cells
    By jdskin2 in forum Excel General
    Replies: 2
    Last Post: 02-09-2012, 04:34 PM
  3. Dropdown filling cells side by side
    By jta at wapa in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-31-2011, 08:00 PM
  4. Fill selected cells by selecting a value from a list
    By davejcohen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-17-2010, 04:33 PM
  5. first value from right side in selected cells
    By danusko in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 05-05-2009, 06:29 AM

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