Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Macro to Hide Rows

I'm using the following macro to hide/show rows, but I get a "run-time error
'1004' Unable to set the Hidden property of the Range Class" if the row
contains a combo box. The combo boxes are inserting information into
adjoining cells on the same row. What could be causing the error?

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$2" Then
Range("2:" & Rows.Count).EntireRow.Hidden = False
Range(CStr(3 + 2 * Range("A2").Value) & ":" & _
Rows.Count).EntireRow.Hidden = True
End If
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Macro to Hide Rows

the error is that there's a combobox in the way & it won't let you
programatically hide the row. there's nothing wrong with the sub
(that i can see).
you'll have to skip the row if it contains a combobox.
hth
susan


On May 14, 9:51*am, New2Macros
wrote:
I'm using the following macro to hide/show rows, but I get a "run-time error
'1004' Unable to set the Hidden property of the Range Class" if the row
contains a combo box. *The combo boxes are inserting information into
adjoining cells on the same row. *What could be causing the error?

Private Sub Worksheet_Change(ByVal Target As Range)
* *If Target.Address = "$A$2" Then
* * *Range("2:" & Rows.Count).EntireRow.Hidden = False
* * *Range(CStr(3 + 2 * Range("A2").Value) & ":" & _
* * * * * * *Rows.Count).EntireRow.Hidden = True
* *End If
*End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Macro to Hide Rows

That will cause a problem, because I need a combo box on every row. Is there
a way to get around this?


"Susan" wrote:

the error is that there's a combobox in the way & it won't let you
programatically hide the row. there's nothing wrong with the sub
(that i can see).
you'll have to skip the row if it contains a combobox.
hth
susan


On May 14, 9:51 am, New2Macros
wrote:
I'm using the following macro to hide/show rows, but I get a "run-time error
'1004' Unable to set the Hidden property of the Range Class" if the row
contains a combo box. The combo boxes are inserting information into
adjoining cells on the same row. What could be causing the error?

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$2" Then
Range("2:" & Rows.Count).EntireRow.Hidden = False
Range(CStr(3 + 2 * Range("A2").Value) & ":" & _
Rows.Count).EntireRow.Hidden = True
End If
End Sub



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Macro to Hide Rows with ComboBoxes

i don't know; maybe someone else can help.
susan

On May 14, 11:45*am, New2Macros
wrote:
That will cause a problem, because I need a combo box on every row. *Is there
a way to get around this?



"Susan" wrote:
the error is that there's a combobox in the way & it won't let you
programatically hide the row. *there's nothing wrong with the sub
(that i can see).
you'll have to skip the row if it contains a combobox.
hth
susan


On May 14, 9:51 am, New2Macros
wrote:
I'm using the following macro to hide/show rows, but I get a "run-time error
'1004' Unable to set the Hidden property of the Range Class" if the row
contains a combo box. *The combo boxes are inserting information into
adjoining cells on the same row. *What could be causing the error?


Private Sub Worksheet_Change(ByVal Target As Range)
* *If Target.Address = "$A$2" Then
* * *Range("2:" & Rows.Count).EntireRow.Hidden = False
* * *Range(CStr(3 + 2 * Range("A2").Value) & ":" & _
* * * * * * *Rows.Count).EntireRow.Hidden = True
* *End If
*End Sub- Hide quoted text -


- Show quoted text -


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Macro to Hide Rows with ComboBoxes

Okay, who could help?

"Susan" wrote:

i don't know; maybe someone else can help.
susan

On May 14, 11:45 am, New2Macros
wrote:
That will cause a problem, because I need a combo box on every row. Is there
a way to get around this?



"Susan" wrote:
the error is that there's a combobox in the way & it won't let you
programatically hide the row. there's nothing wrong with the sub
(that i can see).
you'll have to skip the row if it contains a combobox.
hth
susan


On May 14, 9:51 am, New2Macros
wrote:
I'm using the following macro to hide/show rows, but I get a "run-time error
'1004' Unable to set the Hidden property of the Range Class" if the row
contains a combo box. The combo boxes are inserting information into
adjoining cells on the same row. What could be causing the error?


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$2" Then
Range("2:" & Rows.Count).EntireRow.Hidden = False
Range(CStr(3 + 2 * Range("A2").Value) & ":" & _
Rows.Count).EntireRow.Hidden = True
End If
End Sub- Hide quoted text -


- Show quoted text -



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro code to hide rows and not calculate hidden rows bradmcq Excel Discussion (Misc queries) 0 September 1st 09 12:38 AM
Macro to hide rows? Cam Excel Programming 1 April 22nd 08 07:23 PM
Macro to hide rows Alex Excel Programming 1 November 7th 05 07:09 PM
hide rows with macro Alen32 Excel Programming 8 May 27th 05 01:40 PM
hide rows with macro Macro to hide rows in spreadwsheet Excel Discussion (Misc queries) 3 May 12th 05 05:02 PM


All times are GMT +1. The time now is 07:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"