Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
changing a range of cells throughout a 5 page spreadsheet | Excel Discussion (Misc queries) | |||
changing a formula in multiple cells | Excel Worksheet Functions | |||
help me is it possible to add to multiple cells without changing t | Excel Worksheet Functions | |||
Alternating Changing Color of Cells (a Range) across a Spreadsheet | Excel Programming | |||
changing cells in multiple worksheets | Excel Worksheet Functions |