Can i do this??

  • Thread starter Thread starter majikman
  • Start date Start date
M

majikman

Is it possible to hide rows in a worksheet with a macro so that it look
as if though the cells were deleted then make them reappear with
separate macro
 
Option Explicit
Private mOldHeight

Sub Hide()
mOldHeight = Range(Rows(1), Rows(3)).RowHeight
Range(Rows(1), Rows(3)).RowHeight = 0
End Sub

Sub Unhide()
Range(Rows(1), Rows(3)).RowHeight = mOldHeight
End Sub

Sub Main()
Hide
MsgBox "Row Height: " & mOldHeight
Unhide
End Sub

Bob
 
A simpler way would be:
Rows("4:9").EntireRow.Hidden = True

Recording a macro is a good way to figure these sort of questions out.
Go to Tools/Macro/Record Macro and then do the action that you want
to automate manually.

Cheers,
Andrew
 

Ask a Question

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.

Ask a Question

Back
Top