Microsoft® Excel® based database addin

 

+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Brad E. Guest

    Default .StandardHeight property

    Hi - I have a spreadsheet where a user can enter an integer from 1 to 9.
    Depending on the entry, a WorksheetChange() event hides/displays the
    immediate 9 rows below the entry.

    Case "$A$3" 'Using Select Target.Address
    X = Target.Value + 3
    With ActiveSheet
    For Y = 4 To 12
    If Y <= X Then
    .Rows(Y).RowHeight = .StandardHeight
    Else
    .Rows(Y).RowHeight = 0
    End If
    Next Y
    End With 'End Select

    Somehow, the .Standard Height is at zero and all 9 rows continually get set
    to a height of 0. (.StandardHeight) is a read-only argument, so I am not
    sure how this happened. Can anyone help me get this back to the 12.75 that
    it should be?
    --
    TIA, Brad E.

  2. #2
    Gary Brown Guest

    Default RE: .StandardHeight property

    have you tried ...
    X = Target.ROW + 3
    ???
    --
    Hope this helps.
    If it does, please click the Yes button.
    Thanks in advance for your feedback.
    Gary Brown



    "Brad E." wrote:

    > Hi - I have a spreadsheet where a user can enter an integer from 1 to 9.
    > Depending on the entry, a WorksheetChange() event hides/displays the
    > immediate 9 rows below the entry.
    >
    > Case "$A$3" 'Using Select Target.Address
    > X = Target.Value + 3
    > With ActiveSheet
    > For Y = 4 To 12
    > If Y <= X Then
    > .Rows(Y).RowHeight = .StandardHeight
    > Else
    > .Rows(Y).RowHeight = 0
    > End If
    > Next Y
    > End With 'End Select
    >
    > Somehow, the .Standard Height is at zero and all 9 rows continually get set
    > to a height of 0. (.StandardHeight) is a read-only argument, so I am not
    > sure how this happened. Can anyone help me get this back to the 12.75 that
    > it should be?
    > --
    > TIA, Brad E.


  3. #3
    Rick Rothstein Guest

    Default Re: .StandardHeight property

    What size Standard Font do you show on the General Tab for the Tools/Options
    dialog box (it controls the StandardHeight as far as I know)?

    As for your code... I would not play with the RowHeight property; rather, I
    would use the Hidden property for the Rows range. For example...

    YourStartRow = 3
    Rows(YourStartRow).Resize(9).Hidden = True

    will hide Row 3 and the eight rows beneath it (for a total of nine hidden
    rows). To show the rows, just assign False (instead of True) to the Rows
    statement.

    --
    Rick (MVP - Excel)


    "Brad E." <BradE@discussions.microsoft.com> wrote in message
    news:E154AF3A-512E-4D09-83C1-468FC22B95C9@microsoft.com...
    > Hi - I have a spreadsheet where a user can enter an integer from 1 to 9.
    > Depending on the entry, a WorksheetChange() event hides/displays the
    > immediate 9 rows below the entry.
    >
    > Case "$A$3" 'Using Select Target.Address
    > X = Target.Value + 3
    > With ActiveSheet
    > For Y = 4 To 12
    > If Y <= X Then
    > .Rows(Y).RowHeight = .StandardHeight
    > Else
    > .Rows(Y).RowHeight = 0
    > End If
    > Next Y
    > End With 'End Select
    >
    > Somehow, the .Standard Height is at zero and all 9 rows continually get
    > set
    > to a height of 0. (.StandardHeight) is a read-only argument, so I am not
    > sure how this happened. Can anyone help me get this back to the 12.75
    > that
    > it should be?
    > --
    > TIA, Brad E.



  4. #4
    JLGWhiz Guest

    Default Re: .StandardHeight property

    This syntax works for me:

    ..Rows.UseStandardHeight = True

    It sets the applicable rows to the default height. In your case it would
    be:

    Rows(Y).UseStandardHeight = True


    "Brad E." <BradE@discussions.microsoft.com> wrote in message
    news:E154AF3A-512E-4D09-83C1-468FC22B95C9@microsoft.com...
    > Hi - I have a spreadsheet where a user can enter an integer from 1 to 9.
    > Depending on the entry, a WorksheetChange() event hides/displays the
    > immediate 9 rows below the entry.
    >
    > Case "$A$3" 'Using Select Target.Address
    > X = Target.Value + 3
    > With ActiveSheet
    > For Y = 4 To 12
    > If Y <= X Then
    > .Rows(Y).RowHeight = .StandardHeight
    > Else
    > .Rows(Y).RowHeight = 0
    > End If
    > Next Y
    > End With 'End Select
    >
    > Somehow, the .Standard Height is at zero and all 9 rows continually get
    > set
    > to a height of 0. (.StandardHeight) is a read-only argument, so I am not
    > sure how this happened. Can anyone help me get this back to the 12.75
    > that
    > it should be?
    > --
    > TIA, Brad E.




  5. #5
    Brad E. Guest

    Default RE: .StandardHeight property

    The ROW number won't help. I want to show the number of rows directly under
    cell $A$3 depending on the user-entered VALUE into $A$3. Thanks for the
    thought, though.
    -- Brad E.

    "Gary Brown" wrote:

    > have you tried ...
    > X = Target.ROW + 3
    > ???
    > --
    > Hope this helps.
    > If it does, please click the Yes button.
    > Thanks in advance for your feedback.
    > Gary Brown
    >
    >
    >
    > "Brad E." wrote:
    >
    > > Hi - I have a spreadsheet where a user can enter an integer from 1 to 9.
    > > Depending on the entry, a WorksheetChange() event hides/displays the
    > > immediate 9 rows below the entry.
    > >
    > > Case "$A$3" 'Using Select Target.Address
    > > X = Target.Value + 3
    > > With ActiveSheet
    > > For Y = 4 To 12
    > > If Y <= X Then
    > > .Rows(Y).RowHeight = .StandardHeight
    > > Else
    > > .Rows(Y).RowHeight = 0
    > > End If
    > > Next Y
    > > End With 'End Select
    > >
    > > Somehow, the .Standard Height is at zero and all 9 rows continually get set
    > > to a height of 0. (.StandardHeight) is a read-only argument, so I am not
    > > sure how this happened. Can anyone help me get this back to the 12.75 that
    > > it should be?
    > > --
    > > TIA, Brad E.


  6. #6
    Brad E. Guest

    Default Re: .StandardHeight property

    My Standard Font is Arial-10 and even after the reboot this morning, my rows
    got hidden.

    I have changed my coding to use the .Hidden feature, just like you
    suggested. Now things are working great. Thanks a lot.
    -- Brad E.


    "Rick Rothstein" wrote:

    > What size Standard Font do you show on the General Tab for the Tools/Options
    > dialog box (it controls the StandardHeight as far as I know)?
    >
    > As for your code... I would not play with the RowHeight property; rather, I
    > would use the Hidden property for the Rows range. For example...
    >
    > YourStartRow = 3
    > Rows(YourStartRow).Resize(9).Hidden = True
    >
    > will hide Row 3 and the eight rows beneath it (for a total of nine hidden
    > rows). To show the rows, just assign False (instead of True) to the Rows
    > statement.
    >
    > --
    > Rick (MVP - Excel)
    >
    >
    > "Brad E." <BradE@discussions.microsoft.com> wrote in message
    > news:E154AF3A-512E-4D09-83C1-468FC22B95C9@microsoft.com...
    > > Hi - I have a spreadsheet where a user can enter an integer from 1 to 9.
    > > Depending on the entry, a WorksheetChange() event hides/displays the
    > > immediate 9 rows below the entry.
    > >
    > > Case "$A$3" 'Using Select Target.Address
    > > X = Target.Value + 3
    > > With ActiveSheet
    > > For Y = 4 To 12
    > > If Y <= X Then
    > > .Rows(Y).RowHeight = .StandardHeight
    > > Else
    > > .Rows(Y).RowHeight = 0
    > > End If
    > > Next Y
    > > End With 'End Select
    > >
    > > Somehow, the .Standard Height is at zero and all 9 rows continually get
    > > set
    > > to a height of 0. (.StandardHeight) is a read-only argument, so I am not
    > > sure how this happened. Can anyone help me get this back to the 12.75
    > > that
    > > it should be?
    > > --
    > > TIA, Brad E.

    >
    > .
    >


  7. #7
    Brad E. Guest

    Default Re: .StandardHeight property

    Thanks for the tip JLGWhiz. Your suggestion is more straight-forward than my
    code. After getting Rick Rothstein's suggestion to work by hiding and
    unhiding the rows, though, I am not going to try your suggestion. Besides,
    if I am setting my ".RowHeight = .StandardHeight", I would guess that
    ".UseStandardHeight = True" would still give a height of zero.
    -- Brad E.


    "JLGWhiz" wrote:

    > This syntax works for me:
    >
    > ..Rows.UseStandardHeight = True
    >
    > It sets the applicable rows to the default height. In your case it would
    > be:
    >
    > Rows(Y).UseStandardHeight = True
    >
    >
    > "Brad E." <BradE@discussions.microsoft.com> wrote in message
    > news:E154AF3A-512E-4D09-83C1-468FC22B95C9@microsoft.com...
    > > Hi - I have a spreadsheet where a user can enter an integer from 1 to 9.
    > > Depending on the entry, a WorksheetChange() event hides/displays the
    > > immediate 9 rows below the entry.
    > >
    > > Case "$A$3" 'Using Select Target.Address
    > > X = Target.Value + 3
    > > With ActiveSheet
    > > For Y = 4 To 12
    > > If Y <= X Then
    > > .Rows(Y).RowHeight = .StandardHeight
    > > Else
    > > .Rows(Y).RowHeight = 0
    > > End If
    > > Next Y
    > > End With 'End Select
    > >
    > > Somehow, the .Standard Height is at zero and all 9 rows continually get
    > > set
    > > to a height of 0. (.StandardHeight) is a read-only argument, so I am not
    > > sure how this happened. Can anyone help me get this back to the 12.75
    > > that
    > > it should be?
    > > --
    > > TIA, Brad E.

    >
    >
    > .
    >


Similar Threads

  1. Error Could not set the ControlSource property. Invalid property v
    By Trefor in forum Programming (VBA, VB, C# etc)
    Replies: 2
    Last Post: 03-05-2009, 11:37 PM
  2. Get Property value of class instance by passing string property name
    By mrussell@bluebayinvest.com in forum Programming (VBA, VB, C# etc)
    Replies: 2
    Last Post: 03-05-2009, 08:29 PM
  3. Runtime error 380 - Could not set the list property. Invalid property value.
    By viktorka.mail@gmail.com in forum Programming (VBA, VB, C# etc)
    Replies: 3
    Last Post: 03-01-2009, 01:35 AM
  4. Could not set the ControlSource property. Invalid property value error
    By Ömer Ayzan in forum Programming (VBA, VB, C# etc)
    Replies: 2
    Last Post: 02-07-2009, 06:08 PM
  5. Replies: 2
    Last Post: 01-23-2009, 02:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts