Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Multiple cells hiding rows, changing print area

I need a alteration to my program that will hide various rows and change
print area based on a separate cell than the current one. For example, if I
type .84 into B20 I want it to adjust things as written below, but if I then
type in JP into cell J20 I want it to hide past row 94 and print before that
row. I tried doing this by setting up an all new sub for the worksheet in
addition to this one (using this one as a pattern), but excel didn't like
that.

Sub Worksheet_Change(ByVal Target As Range)
Dim v As Double

Set t = Target
Set r = Range("B20")
If Intersect(t, r) Is Nothing Then
Exit Sub
Else
v = Val(r.Value)
End If
Select Case v
Case 0.9, 0.94, 0.76, 0.75, 0.78
Rows("63:93").EntireRow.Hidden = False
Rows("94:124").EntireRow.Hidden = True
ActiveSheet.PageSetup.PrintArea = "$A$1:I$93"
Case 0.84
Rows("63:124").EntireRow.Hidden = True
ActiveSheet.PageSetup.PrintArea = "$A$1:$I$62"
Case Is < 0.75, Is 0.94, Is 0.79 < 0.84
Rows("63:124").EntireRow.Hidden = False
ActiveSheet.PageSetup.PrintArea = "$A$1:$I$124"
Case Is 0.84 < 0.9, Is 0.9 < 0.94
Rows("63:124").EntireRow.Hidden = False
ActiveSheet.PageSetup.PrintArea = "$A$1:$I$124"
End Select
End Sub
Reply
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
Macro to hide rows with a certain cell empty then set print area and print tahrah Excel Programming 12 January 9th 07 03:47 AM
Macro - Set Print Area for Changing Data Area ksp Excel Programming 5 May 15th 06 10:20 PM
print area selection slows excel, formula for hiding rows?? sbrimley Excel Discussion (Misc queries) 1 March 21st 06 11:26 PM
Changing print area Aaron Excel Discussion (Misc queries) 2 January 9th 05 05:58 PM
Changing Print area JT[_2_] Excel Programming 2 May 9th 04 04:06 AM


All times are GMT +1. The time now is 08:13 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"