When I've entered codes in before, I click on the tab for this worksheet,
select View Code, choose Insert Module, and then insert the code. There is
already a code in this worksheet for something else, so I can't just add it
in after selecting View Code. Am I putting the code in the wrong spot?
Should I be choosing something else other than Insert Module?
I've tried out so many different codes thinking that was the problem, but
now I think I may just be entering it wrong. I appreciate your help.
"Jacob Skaria" wrote:
> Select the sheet tab which you want to work with. Right click the sheet tab
> and click on 'View Code'. This will launch VBE. Paste the below code to the
> right blank portion. Get back to to workbook and try out.
>
>
> Private Sub Worksheet_Change(ByVal Target As Range)
> If Target.Column = 4 Then Rows(Target.Row).Hidden = (UCase(Target.Text) = "N")
> End Sub
>
> --
> Jacob (MVP - Excel)
--From workbook launch VBE using short-key Alt+F11.
--From menu 'Insert' a module and paste the below code.
--Get back to Workbook.
--Run macro from Tools|Macro|Run <selected macro()>
Sub MyMacro()
Dim lngRow As Long
For lngRow = 1 To Cells(Rows.Count, "D").End(xlUp).Row
Rows(lngRow).Hidden = (UCase(Range("D" & lngRow)) = "N")
Next