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 for changing my spreadsheet?

Is it possible to use various cells to affect my spreadsheet? I need to 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 "US Formula" into cell J20 I want it to hide
rows 94 to 124 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.84
Rows("63:124").EntireRow.Hidden = True
ActiveSheet.PageSetup.PrintArea = "$A$1:$I$62"
Case Is < 0.84
Rows("63:124").EntireRow.Hidden = False
ActiveSheet.PageSetup.PrintArea = "$A$1:$I$124"
Case Is 0.84
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
changing a range of cells throughout a 5 page spreadsheet Midwest Farmers Excel Discussion (Misc queries) 1 October 21st 08 07:39 PM
changing a formula in multiple cells casdaq Excel Worksheet Functions 2 April 30th 07 11:54 PM
help me is it possible to add to multiple cells without changing t wishing well Excel Worksheet Functions 1 August 25th 06 08:20 AM
Alternating Changing Color of Cells (a Range) across a Spreadsheet jeff Excel Programming 3 March 31st 06 12:35 AM
changing cells in multiple worksheets boyd Excel Worksheet Functions 2 May 23rd 05 10:10 PM


All times are GMT +1. The time now is 05:29 PM.

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"