Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Macro to Unhide MulipleRows if Cell B10 has a "X" otherwise hide c

Trying to create a macro where if Cell B10 or B11 has an "X" then Rows 15-19
are unhiden. If B10 and B11 are both blank then rows 15-19 is hidden.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Macro to Unhide MulipleRows if Cell B10 has a "X" otherwise hide c

Hi

Try this:

Sub aaa()
If Range("B10").Value = "X" Or Range("B11").Value = "X" Then
Rows("15:19").Hidden = False
Else
Rows("15:19").Hidden = True
End If
End Sub

Regards,
Per

"Leiprecht" skrev i meddelelsen
...
Trying to create a macro where if Cell B10 or B11 has an "X" then Rows
15-19
are unhiden. If B10 and B11 are both blank then rows 15-19 is hidden.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Macro to Unhide MulipleRows if Cell B10 has a "X" otherwise hi

That works! How can i get it to automatically do everytime the cell is
changed?

"Per Jessen" wrote:

Hi

Try this:

Sub aaa()
If Range("B10").Value = "X" Or Range("B11").Value = "X" Then
Rows("15:19").Hidden = False
Else
Rows("15:19").Hidden = True
End If
End Sub

Regards,
Per

"Leiprecht" skrev i meddelelsen
...
Trying to create a macro where if Cell B10 or B11 has an "X" then Rows
15-19
are unhiden. If B10 and B11 are both blank then rows 15-19 is hidden.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Macro to Unhide MulipleRows if Cell B10 has a "X" otherwise hide c

Hi,

Right click your sheet tab, view code and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If UCase(Range("B10")) = "X" Or UCase(Range("B11")) = "X" Then
Rows(15 & ":" & 19).EntireRow.Hidden = False
ElseIf WorksheetFunction.CountA(Range("B10:B11")) = 0 Then
Rows(15 & ":" & 19).EntireRow.Hidden = True
End If
End Sub

Mike

"Leiprecht" wrote:

Trying to create a macro where if Cell B10 or B11 has an "X" then Rows 15-19
are unhiden. If B10 and B11 are both blank then rows 15-19 is hidden.

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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
macro to hide all rows that have a cell value of "complete" Maax Excel Programming 1 March 29th 07 08:12 AM
macro to hide all rows that have a cell value of "complete" Vergel Adriano Excel Programming 0 March 28th 07 02:43 AM
macro to hide all rows that have a cell value of "complete" Maax Excel Programming 1 March 28th 07 02:19 AM
If "x" Hide / Unhide Rows Ed Excel Discussion (Misc queries) 4 April 18th 06 06:39 PM


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