ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can i do this?? (https://www.excelbanter.com/excel-programming/297999-can-i-do.html)

majikman[_13_]

Can i do this??
 
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

--
Message posted from http://www.ExcelForum.com


Bob Kilmer[_2_]

Can i do this??
 
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

"majikman " wrote in message
...
Is it possible to hide rows in a worksheet with a macro so that it looks
as if though the cells were deleted then make them reappear with a
separate macro?


---
Message posted from http://www.ExcelForum.com/




Andrew[_16_]

Can i do this??
 
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



"Bob Kilmer" wrote in message ...
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

"majikman " wrote in message
...
Is it possible to hide rows in a worksheet with a macro so that it looks
as if though the cells were deleted then make them reappear with a
separate macro?


---
Message posted from http://www.ExcelForum.com/



All times are GMT +1. The time now is 04:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com