LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
sarcher
 
Posts: n/a
Default Hiding Rows in a VBA macro


Hi,

I want to set up a looping macro in VBA so that it looks at the first
column of the work book and if this is empty, the entire row is
hidden.

I have got the code below - the lopping works just cant get the correct
code for hidding the row.

SUB PRINTPAGE()

DIM MAIN AS WORKSHEET
DIM MROW AS LONG
SET MAIN = THISWORKBOOK.WORKSHEETS(\"WORKPLANNER\")
MROW = 8

DO UNTIL MROW = 352

IF MAIN.CELLS(MROW, 1) = \"\" THEN
-MAIN.CELLS(MROW, \"\") = \"TEST\"-ELSE
END IF
MROW = MROW + 1
LOOP
END SUB

also when i print a worksheet with a number of hidden rows is there a
way for Excel to ignore these completely.


Thanks

Steven


--
sarcher
------------------------------------------------------------------------
sarcher's Profile: http://www.excelforum.com/member.php...o&userid=34457
View this thread: http://www.excelforum.com/showthread...hreadid=542123

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
resetting last cell jagdish.eashwar Excel Discussion (Misc queries) 11 March 31st 06 02:06 AM
print area selection slows excel, formula for hiding rows?? sbrimley Excel Discussion (Misc queries) 1 March 21st 06 11:26 PM
Macro to delete rows with same data Connie Martin Excel Worksheet Functions 12 November 22nd 05 01:18 PM
Hiding rows before printing DaveM Excel Discussion (Misc queries) 3 April 16th 05 11:38 AM
Adding Rows to Master Sheet Excel Newbie New Users to Excel 1 December 23rd 04 10:56 PM


All times are GMT +1. The time now is 07:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"