You can of course hide entire columns and rows, but that means you have to
have a rectangular collection of cells on show.
You could consider masking the cells, set background and foreground colors
the same, lock these cells, unlock the cells you want to show (if need you
need to edit) and then protect the sheet.
Sub hidenonused()
With Range("a1:b12")
lr = .Rows.count + 1
'MsgBox lr
lc = .Columns.count + 1
'MsgBox lc
'MsgBox Columns.count
End With
Rows(lr & ":" & Rows.count).Hidden = True
Range(Cells(1, lc), Cells(1, Columns.count)).EntireColumn.Hidden = True
End Sub
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.