Dim cell As Range

On Error Resume Next
For Each cell In Rows(6).Cells
cell.EntireColumn.Hidden = cell.Value > Range("D1").Value
Next cell


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Karen McKenzie" <KarenMcKenzie@discussions.microsoft.com> wrote in message
news:DF20BF8E-4474-434E-B1A2-10977D97E2A4@microsoft.com...
> My spreadsheet has numerous sections all with period numbers 1-12 showing

in
> columns on line 6. Line 6 also contains some blank cells and text cells.
> Cell D1 contains the current period number.
> I want to be able to hide any columns where the number in line 6 is

greater
> than the value in cell D1
> ie if D1 is 4, then any columns in the spreadsheet that contain a number
> greater than 4 in line 6 would be hidden.
>
> Can anyone help please.