VBA Code for Auto Hide/Unhide Rows Based on above Row

Ken0356

New Member
Joined
Sep 30, 2020
Messages
10
Office Version
  1. 365
Platform
  1. Windows
Looking for VBA code to insert into my log workbook. I want a specific range of rows to be auto hidden until the row above it has value. This needs to repeat each time, so an example I want row 25 to appear once 24 is filled in, and the 26 to appear once 25 is filled in, and so on... Basically my log well be linked to hidden worksheets (field reports), that have certain cells that are linked back to the log report page. I want the the user not to see all of the unfilled in reports until they start progressing that far through the project, thus making it more printer friendly. In the end I'm got to have the first 25 rows/field reports visible on the log page and once they get past 25 and additional row will be come visible so they can continue filling in reports. Note in the end there will be 100 field reports that will be in this workbook. Hopefully this makes sense.
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
55,393
Office Version
  1. 365
Platform
  1. Windows
So are you saying that you want it to run off a change in value due to an existing formula?
The Worksheet_Change event procedure runs off of a manual change to a cell. Values that change due to formulas do NOT trigger this event.
You would need something else, like maybe a Worksheet_Calculate event procedure.
 

Some videos you may like

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Ken0356

New Member
Joined
Sep 30, 2020
Messages
10
Office Version
  1. 365
Platform
  1. Windows
Okay thanks.
Not sure where to go from here other than just have them manually unhide rows when they are ready to display and fill in more report sheets.
 

scotthannaford1973

Board Regular
Joined
Sep 27, 2017
Messages
60
Office Version
  1. 2010
Platform
  1. Windows
you could also use conditional formatting to make the cells and text white, to hide them - obviously not what you really need, but its what I use as a shortcut.
 

Watch MrExcel Video

Forum statistics

Threads
1,118,269
Messages
5,571,231
Members
412,372
Latest member
JON_ROCKS
Top