View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
[email protected] pfsardella@yahoo.com.nospam is offline
external usenet poster
 
Posts: 172
Default How to hide row range from code?

Vladimir. Here's a start.

Sub HideRows()
Dim X As Integer, Y As Integer

X = Cells(1, 1).Value
Y = Cells(2, 1).Value
If X < 1 Or Y < 1 Then Exit Sub

Rows("" & X & ":" & Y & "").Hidden = True

End Sub

Tested using Excel 97SR2 on Windows 98SE,

HTH
Paul
--------------------------------------------------------------------------------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------------------------------------------

Hello,

I use VB in Excel.
I want to hide part of Worksheet from row X to row Y.
X and Y should be integers marking rows where specific cell values (string
constants) were found.

In Excel VBA Help for me this is not clear enough. For example, how to
manipulate rows and their properties, it is only "range" and "cells".

Can someone give me an example?

Regards,
Vladimir