You can do what you request using VBA code. The suggested sub runs automatically when you change the value of cell A6.
Make sure you put the sub in the code pane for the worksheet being watched. Rightclick its sheet tab, choose View Code... and paste the sub there. Make sure you save the workbook with .xls, .xlsm or .xlsb file extension.
'Put this sub in the code pane for the worksheet being watched
Private Sub Worksheet_Change(ByVal Target As Range)
Dim targ As Range, watch As Range
Set targ = Me.Range("9:258")
Set watch = Me.Range("A6")
If Not Intersect(watch, Target) Is Nothing Then
On Error Resume Next
targ.EntireRow.Hidden = True
targ.Resize(watch.Value).EntireRow.Hidden = False