ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hide Excel row in VBA (https://www.excelbanter.com/excel-programming/294384-hide-excel-row-vba.html)

RichC[_2_]

Hide Excel row in VBA
 
Help! I'm using Excel 97 and I am trying to hide a
spreadsheet row using VBA. This code is not working:

activesheet.Rows("28").Hidden = True

The message is 'unable to set the Hidden property of the
Range class.' The sheet is not protected.

Any suggestions?

Rich

Dave Peterson[_3_]

Hide Excel row in VBA
 
How are you running the code?

If it's from a control from the control toolbox toolbar, try adding:

activecell.activate

near the top of your code.

(or change the .takefocusonclick to false (if the control has that property.))



RichC wrote:

Help! I'm using Excel 97 and I am trying to hide a
spreadsheet row using VBA. This code is not working:

activesheet.Rows("28").Hidden = True

The message is 'unable to set the Hidden property of the
Range class.' The sheet is not protected.

Any suggestions?

Rich


--

Dave Peterson


Rodney Baker

Hide Excel row in VBA
 
I use something like
activecell.entirerow.hidden = true

or

Rows("28").EntireRow.Hidden = True

Either should work.

Rodney.

"Dave Peterson" wrote in message
...
How are you running the code?

If it's from a control from the control toolbox toolbar, try adding:

activecell.activate

near the top of your code.

(or change the .takefocusonclick to false (if the control has that

property.))



RichC wrote:

Help! I'm using Excel 97 and I am trying to hide a
spreadsheet row using VBA. This code is not working:

activesheet.Rows("28").Hidden = True

The message is 'unable to set the Hidden property of the
Range class.' The sheet is not protected.

Any suggestions?

Rich


--

Dave Peterson




Tom Ogilvy

Hide Excel row in VBA
 
Not if the problem is as Dave Peterson suggests.

--
Regards,
Tom Ogilvy

"Rodney Baker" wrote in message
...
I use something like
activecell.entirerow.hidden = true

or

Rows("28").EntireRow.Hidden = True

Either should work.

Rodney.

"Dave Peterson" wrote in message
...
How are you running the code?

If it's from a control from the control toolbox toolbar, try adding:

activecell.activate

near the top of your code.

(or change the .takefocusonclick to false (if the control has that

property.))



RichC wrote:

Help! I'm using Excel 97 and I am trying to hide a
spreadsheet row using VBA. This code is not working:

activesheet.Rows("28").Hidden = True

The message is 'unable to set the Hidden property of the
Range class.' The sheet is not protected.

Any suggestions?

Rich


--

Dave Peterson







All times are GMT +1. The time now is 01:29 PM.

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