+ Reply to Thread
Results 1 to 6 of 6

Adjust selected Range

  1. #1
    Forum Contributor
    Join Date
    08-07-2013
    Location
    mo
    MS-Off Ver
    Excel 2010
    Posts
    453

    Adjust selected Range

    This macro works great. It selects all the cells between two cell values. I need to adjust it a bit.

    Right now it goes down column "C" and finds "Hamilton" and "Hamilton Total" and selects all the cells between. I need it to select only the cells in Column "D" in the same rows except the last one.

    Here is an example of what I need:
    If,
    C10 = Hamilton
    C15 = Hamilton Total

    Select,
    D10:D14

    Right now this code will select C10:C15


    HTML Code: 

  2. #2
    Forum Contributor
    Join Date
    12-14-2013
    Location
    Tilburg, Nederland
    MS-Off Ver
    Excel 2010
    Posts
    256

    Re: Adjust selected Range

    Try
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    08-07-2013
    Location
    mo
    MS-Off Ver
    Excel 2010
    Posts
    453

    Re: Adjust selected Range

    Almost. It selects the correct row, but is off one cell. It selects D9:D13

    I need it to do D10:D14

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Adjust selected Range

    Try this.
    [code]
    Sub BDown()
    Dim rng As Range
    Set rng = Range("C1:C" & Cells(Rows.Count, 3).End(xlUp).Row)
    With ActiveSheet
    .Range(rng.Find("Hamilton").Offset(,1), rng.Find("Hamilton Total").Offset(-1,1)).Select
    End With
    End Sub
    If posting code please use code tags, see here.

  5. #5
    Forum Contributor
    Join Date
    12-14-2013
    Location
    Tilburg, Nederland
    MS-Off Ver
    Excel 2010
    Posts
    256

    Re: Adjust selected Range

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    08-07-2013
    Location
    mo
    MS-Off Ver
    Excel 2010
    Posts
    453

    Re: Adjust selected Range

    Awesome. The both worked. Thanks for the help.....

+ 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. Loop backwards through selected range - delete entire row from selected cells
    By scottbass in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-20-2014, 09:21 AM
  2. How to adjust data date range based on analysis range
    By MechEngSk in forum Excel General
    Replies: 1
    Last Post: 09-15-2013, 11:28 PM
  3. How do you adjust the macro so it works on the selected row?
    By Jlosness in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-08-2011, 12:01 PM
  4. Adjust Row Range Where Combobox in Selected Cell Appears
    By bdb1974 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-26-2011, 05:44 PM
  5. Adjust selected range
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-17-2008, 11:56 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