Thanks Thanks:  0
Likes Likes:  0
Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: Select Section between blank rows

  1. #11
    Board Regular DanteAmor's Avatar
    Join Date
    Dec 2018
    Location
    México
    Posts
    3,176
    Post Thanks / Like
    Mentioned
    26 Post(s)
    Tagged
    9 Thread(s)

    Default Re: Select Section between blank rows

    It would be more effective if you help us with an image of what you have before the formats and another image with what you expect of result.
    Regards Dante Amor

  2. #12
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    21,772
    Post Thanks / Like
    Mentioned
    355 Post(s)
    Tagged
    36 Thread(s)

    Default Re: Select Section between blank rows

    In that case how about
    Code:
    Sub srschicago()
       Dim Rng As Range
       For Each Rng In Range("A:A").SpecialCells(xlConstants).Areas
          Rng.Offset(1, 1).Resize(Rng.Count - 1).Interior.Color = 12566463
          Rng.Offset(1).Resize(Rng.Count - 1, 5).Borders.Weight = xlMedium
       Next Rng
    End Sub
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 2003 & 2013 on Win 7

  3. #13
    Board Regular
    Join Date
    Apr 2017
    Posts
    59
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Select Section between blank rows

    Disregard the Col C Date issue after the section. I change the macro to delete the date cell earlier in the process.

  4. #14
    Board Regular
    Join Date
    Apr 2017
    Posts
    59
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Select Section between blank rows

    Quote Originally Posted by Fluff View Post
    In that case how about
    Code:
    Sub srschicago()
       Dim Rng As Range
       For Each Rng In Range("A:A").SpecialCells(xlConstants).Areas
          Rng.Offset(1, 1).Resize(Rng.Count - 1).Interior.Color = 12566463
          Rng.Offset(1).Resize(Rng.Count - 1, 5).Borders.Weight = xlMedium
       Next Rng
    End Sub
    Thanks Fluff, but your code formats all of the sections with data in Col A and I do not want this. Only the section attached to the title cell I have selected. I would also like to sort the data by Col A so getting the range selected seems necessary.

  5. #15
    MrExcel MVP Rick Rothstein's Avatar
    Join Date
    Apr 2011
    Location
    New Jersey, USA
    Posts
    34,340
    Post Thanks / Like
    Mentioned
    84 Post(s)
    Tagged
    31 Thread(s)

    Default Re: Select Section between blank rows

    Quote Originally Posted by srschicago View Post
    Thanks Fluff, but your code formats all of the sections with data in Col A and I do not want this. Only the section attached to the title cell I have selected. I would also like to sort the data by Col A so getting the range selected seems necessary.
    Please read Message #11 ... complying with it will remove the necessity to keep guessing at what your data looks like and what you are ultimately trying to do with it (as they say, a picture is worth a thousand words).
    Rick's "mini" blog... http://www.excelfox.com/forum/f22/
    .
    Want to post a small screen shot? See Part B here.

  6. #16
    Board Regular
    Join Date
    Apr 2017
    Posts
    59
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Select Section between blank rows

    I installed the MrExcel HTML Maker and added the add-in to Excel. The buttons to select options were activating, but the button to create the HTML image would not. I gave up on it because of time.
    Speaking of your time, thank you all for yours. I solved my problem using CurrentRegion after all.
    Basically I have a series of tables vertically aligned and separated by blank rows. Each table has a Title cell above it.
    Here is the code I used to format the 2nd table. The Title cell is where I start in for the macro.
    [CODE]<>
    Sub rangeselect()
    ActiveCell.Select
    Selection.CurrentRegion.Offset(1).Resize(Selection.CurrentRegion.Rows.Count - 1).Select
    'Format borders....
    Selection.CurrentRegion.Offset(1, 1).Resize(Selection.CurrentRegion.Rows.Count - 1, _
    Selection.CurrentRegion.Columns.Count - 4).Select
    'Fill Column B with gray...

    End Sub
    [END]<>
    Sorry that I don't remember the correct code posing syntax.
    Last edited by srschicago; Apr 21st, 2019 at 12:33 AM.

  7. #17
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    21,772
    Post Thanks / Like
    Mentioned
    355 Post(s)
    Tagged
    36 Thread(s)

    Default Re: Select Section between blank rows

    Glad you sorted it & thanks for the feedback
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 2003 & 2013 on Win 7

  8. #18
    Board Regular DanteAmor's Avatar
    Join Date
    Dec 2018
    Location
    México
    Posts
    3,176
    Post Thanks / Like
    Mentioned
    26 Post(s)
    Tagged
    9 Thread(s)

    Default Re: Select Section between blank rows

    If you have problems with MrExcel HTML Maker, you can install Excel_Jeanie_Html

    https://onedrive.live.com/?id=8CFFDE...FFDEC0CE27E813

    Or you can upload images to dropbox.
    Regards Dante Amor

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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