Thread: removing rows.
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz[_2_] JLGWhiz[_2_] is offline
external usenet poster
 
Posts: 1,565
Default removing rows.

Copy this code and paste it into the Sheet named
"Input Data" code module. To access the code module,
right click the sheet tab and then click View Code
on the pop up menu.


Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("F3") And _
Target.Value < "Vertical" Then
Sheets("Input Data") _
.Range("a101, a103, a105, a107, a109, a111, a113") _
.EntireRow.Hidden = True

ElseIf Target < Range("F3") And Target.Value < "PTA" Then
Sheets("2 Page").Rows("11:17").Hidden = True
Sheets("2 Page").Rows("20:25").Hidden = True
Else
Sheets("Input Data") _
.Range("a101,a103, a105, a107, a109, a111, a113") _
.EntireRow.Hidden = False
Sheets("2 Page").Rows("11:17").Hidden = False
Sheets("2 Page").Rows("20:25").Hidden = False
End If
End Sub



"Raz" wrote in message
...
How to remove rows in one sheet according to values (text) entered in
another
sheet.

If I do not enter text "PTA" (but anything else) in a sheet named "Input
Data", on another sheet named "2 Page" these rows (11,12,13,14,15,16,17,
20,21,22,23,24,25) should dissappear.

Also If I enter anything else, other than word "Vertical" in cell F3 of
"Input Data", rows 101,103,105,107,109,111,113 should dissappear in the
sheet
named "2 Page"

when these conditions not true I want these rows to re-appear.

If I need to use macro or other codings please explain, As I am new to
this.

Thanks in advance