+ Reply to Thread
Results 1 to 8 of 8

Setting visible cell range apart from header

  1. #1
    Forum Contributor
    Join Date
    06-20-2021
    Location
    UK
    MS-Off Ver
    2016
    Posts
    126

    Setting visible cell range apart from header

    Please Login or Register  to view this content.
    At the moment the first line of code selects the header as well.

    Any idea how to exclude the header?

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Setting visible cell range apart from header

    Which row is the header on?

    WBD
    Office 365 on Windows 11, looking for rep!

  3. #3
    Forum Contributor
    Join Date
    06-20-2021
    Location
    UK
    MS-Off Ver
    2016
    Posts
    126
    Quote Originally Posted by WideBoyDixon View Post
    Which row is the header on?

    WBD
    G1. Or, first row. Tried changing first argument from g1: to g2 but to no avail.

    G = 7 col index

  4. #4
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Setting visible cell range apart from header

    Two things:

    1. Aren't you missing a ".Row" after .End(xlUp) ?
    2. You're setting the entire Range value to be "Released" if any cell is not already "Released" - why not just do Rng.Value = "Released" - no point doing the test?

    Please Login or Register  to view this content.
    WBD
    Last edited by WideBoyDixon; 11-10-2021 at 12:45 PM.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,492

    Re: Setting visible cell range apart from header

    Think this:
    Please Login or Register  to view this content.
    should be this:
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  6. #6
    Forum Contributor
    Join Date
    06-20-2021
    Location
    UK
    MS-Off Ver
    2016
    Posts
    126

    Re: Setting visible cell range apart from header

    Quote Originally Posted by WideBoyDixon View Post
    Two things:

    1. Aren't you missing a ".Row" after .End(xlUp) ?
    2. You're setting the entire Range value to be "Released" if any cell is not already "Released" - why not just do Rng.Value = "Released" - no point doing the test?

    Please Login or Register  to view this content.
    WBD
    Thanks it worked. Should have done it the easier way.

    Also, row 1 changes to released even though I specified row 2 to be starting range.

    So for that I added if condition to change to value back to original column if it turns out to be the case.

  7. #7
    Forum Contributor
    Join Date
    06-20-2021
    Location
    UK
    MS-Off Ver
    2016
    Posts
    126

    Re: Setting visible cell range apart from header

    Quote Originally Posted by TMS View Post
    Think this:
    Please Login or Register  to view this content.
    should be this:
    Please Login or Register  to view this content.
    What is the difference between .Cells(.Rows.Count,7) and Cells(Rows.Count,7)?

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,492

    Re: Setting visible cell range apart from header

    Ignore me. Total confusion.

+ 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] Can't set Range Name as "Header cell" and suffix without changing Header itself
    By Ochimus in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-13-2018, 07:06 AM
  2. [SOLVED] Setting the Visible Property of a Worksheet
    By EdWoods in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-16-2018, 02:18 AM
  3. Select visible range and add page break after every 20th visible cell
    By tuc47285 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-04-2015, 01:18 AM
  4. [SOLVED] Copy range from one sheet and paste in another sheet on the next visible row after header
    By MaQian in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-22-2013, 10:48 AM
  5. Setting visible range
    By ZipCurs in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-04-2006, 11:45 PM
  6. [SOLVED] Help finding error setting range to Visible Cells
    By Ed in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-26-2005, 03:06 PM

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