Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a workbook which currently has 3 sheets. Currently All the
information in entered on a sheet titled <Data Entry. The information is then displayed in a Sheet 2. Some or the rows in Sheet 2, don't always have information in them so I got a macro that will hide those rows, I created a column <AJ which either has a constant value in it if I never want it hidden or it pulls the value from some where in sheet 2 to determine if it is blank or not. Currently the macro only runs when you click on a cell in sheet 2 or when you change cells in sheet 2. I would like it to run when ever you print sheet 2, and when you print preview sheet 2, or if possible to run when ever information in the <Data Entry sheet is changed if possible. My code is entered in the sheet 2 section of VB and looks like this: < Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) Dim cell As Range Application.ScreenUpdating = False With ActiveSheet.UsedRange .Rows.Hidden = False For Each cell In Range("AJ1:AJ98") If cell.Value = "" Then _ cell.EntireRow.Hidden = True Next cell End With End Sub Thanks in advance for your help and advice. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro recorded... tabs & file names changed, macro hangs | Excel Worksheet Functions | |||
Macro not showing in Tools/Macro/Macros yet show up when I goto VBA editor | Excel Programming | |||
Need syntax for RUNning a Word macro with an argument, called from an Excel macro | Excel Programming | |||
macro to delete entire rows when column A is blank ...a quick macro | Excel Programming | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming |