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.
 
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.
 
Upvote 0

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
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.
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,214,541
Messages
6,120,110
Members
448,945
Latest member
Vmanchoppy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top