#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default Need help with Macro

How do i get it to due the following

IF L62 = 0 Hide Rows 63:147
IF L62 = 1 Unhide Rows 63:69
IF L62 = 2 Unhide Rows 63:75
If L62 = 3 Unhide Rows 63:81
If L62 = 4 Unhide Rows 63:87
If L62 = 5 Unhide Rows 63:93
If L62 = 6 Unhide Rows 63:99
If L62 = 7 Unhide Rows 63:105
If L62 = 8 Unhide Rows 63:111
If L62 = 9 Unhide Rows 63:117
If L62 = 10 Unhide Rows 63:123
If L62 = 11 Unhide Rows 63:129
If L62 = 12 Unhide Rows 63:135
If L62 = 13 Unhide Rows 63:141
If L62 = 14 Unhide Rows 63:147
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default Need help with Macro

Sub hhide_uunhide

With Range("L62")
If .Value = 0 Then
Range("63:147").EntireRow.Hidden = True
Elseif .Value = 1 Then
Range("63:69").EntireRow.Hidden = False
ElseIf .Value = 2 Then
Range("63:75").EntireRow.Hidden = True
....
End If
End With

End Sub

continue the ElseIf clause for the remaining ranges/rows where "..."




Użytkownik "Leiprecht" napisał w
wiadomo¶ci ...
How do i get it to due the following

IF L62 = 0 Hide Rows 63:147
IF L62 = 1 Unhide Rows 63:69
IF L62 = 2 Unhide Rows 63:75
If L62 = 3 Unhide Rows 63:81
If L62 = 4 Unhide Rows 63:87
If L62 = 5 Unhide Rows 63:93
If L62 = 6 Unhide Rows 63:99
If L62 = 7 Unhide Rows 63:105
If L62 = 8 Unhide Rows 63:111
If L62 = 9 Unhide Rows 63:117
If L62 = 10 Unhide Rows 63:123
If L62 = 11 Unhide Rows 63:129
If L62 = 12 Unhide Rows 63:135
If L62 = 13 Unhide Rows 63:141
If L62 = 14 Unhide Rows 63:147



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Need help with Macro

In the below code; I have marked a line. If you want only that section to be
displayed then remark the line and try...If you are new to macros Set the
Security level to low/medium in (Tools|Macro|Security). 'Launch VBE using
short-key Alt+F11. Insert a module and paste the below code. Save. Get back
to Workbook. Tools|Macro|Run Macro1()

Sub Macro1()
If Range("L62").Value = 0 Then
Rows("63:147").EntireRow.Hidden = True
Else
'Rows("63:147").EntireRow.Hidden = True
Rows("63:" & 63 + (Range("L62").Value * 6)).EntireRow.Hidden = False
End If
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"Leiprecht" wrote:

How do i get it to due the following

IF L62 = 0 Hide Rows 63:147
IF L62 = 1 Unhide Rows 63:69
IF L62 = 2 Unhide Rows 63:75
If L62 = 3 Unhide Rows 63:81
If L62 = 4 Unhide Rows 63:87
If L62 = 5 Unhide Rows 63:93
If L62 = 6 Unhide Rows 63:99
If L62 = 7 Unhide Rows 63:105
If L62 = 8 Unhide Rows 63:111
If L62 = 9 Unhide Rows 63:117
If L62 = 10 Unhide Rows 63:123
If L62 = 11 Unhide Rows 63:129
If L62 = 12 Unhide Rows 63:135
If L62 = 13 Unhide Rows 63:141
If L62 = 14 Unhide Rows 63:147

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 Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
using a cell value to control a counter inside a macro and displaying macro value ocset Excel Worksheet Functions 1 September 10th 06 05:32 AM


All times are GMT +1. The time now is 02:30 PM.

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

About Us

"It's about Microsoft Excel"