Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have written the code below to switch on and off a
coloured input range. The code worked fine in its raw form but as I try to make it more concise I have encountered problems, such as VBA suggesting there should be an '=' after my call to Reveal_Cells Have I misunderstood the nature of subroutines?? Steve Sub alterSheet() Hide_Cells (Range("C22:L28")) End Sub Sub alterSheet2() Reveal_Cells (3,Range("C21:L28")) 'wants = here?? End Sub Private Sub Hide_Cells(Rng As Range) Dim c As Range For Each c In Rng.Cells c.Interior.ColorIndex = 2 c.Font.ColorIndex = 2 c.Value = 0 Next c End Sub Private Sub Reveal_Cells(Default_Value As Variant, Rng As Range) Dim c As Range For Each c In Rng.Cells c.Interior.ColorIndex = 19 c.Font.ColorIndex = 5 c.Value = Default_Value Next c End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problem with code | Excel Discussion (Misc queries) | |||
VB Code Problem | Excel Discussion (Misc queries) | |||
XLS to CSV Code Problem | Excel Worksheet Functions | |||
Code problem | Excel Programming | |||
Code Problem ! | Excel Programming |