Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 171289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:57:42+00:00 2026-05-11T12:57:42+00:00

EDIT: This was happening because the cell was set to the button’s LinkedCell property.

  • 0

EDIT:

This was happening because the cell was set to the button’s LinkedCell property. When I set that to null everything works fine (of course, I was using that property, but oh well).

Couldn’t find anything on this through Google…

I have a cell that contains a fair amount of text in a fairly narrow column. I would like to have a button used to expand/retract the height of the cell when it is pushed (you know, ‘Show’ and ‘Hide’). The thing is, whenever I set the RowHeight property of the cell, the cell’s value is set to TRUE or FALSE. Can someone enlighten me as to why this is?

BTW, I am using Excel 2003.

Private Sub ToggleButton1_Click()     new_caption = ToggleButton1.Caption     Dim height As Integer     If new_caption = 'Show' Then         new_caption = 'Hide'         height = 125     Else         new_caption = 'Show'         height = ToggleButton1.height     End If     ToggleButton1.Caption = new_caption     Range(ToggleButton1.LinkedCell).RowHeight = height End Sub 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T12:57:43+00:00Added an answer on May 11, 2026 at 12:57 pm

    That works fine for me, although I’m using Office XP rather than 2003. Are you sure that’s the code (or only code) that’s running for that button?

    It sets the height correctly but doesn’t change the contents of the cell at all.

    I’ve tried this as both a macro driven by a keypress and a command button on the sheet without a problem.

    UPDATE:

    Based on your edit where you state that you’re using LinkedCell to find the cell from your button, I don’t think your using it properly. LinkedCell binds the value of the cell to the value of the control.

    What’s happening when you press the button is that its value is being set to a boolean (possibly true when pressed then false when released, I don’t know for sure). Because this is linked to a cell, the cells value is also changing to the button value. You need to find a different way to ‘link’ the button to the cell.

    My first thought would be to link it to cell B1 so that your values are in A1, A2, A3, … (let’s call them Ax) and your controls buttons are in (and linked to) Bx and don’t use Bx for anything else (the buttons will probably appear above them anyway).

                 A               B   +--------------------+--------+ 1 | Long text which is | [Hide] |   | wrapped because    |        |   | the state is SHOW. |        |   +--------------------+--------+ 2 | More text which is | [Hide] |   | wrapped because    |        |   | the state is SHOW. |        |   +--------------------+--------+ 3 | Hidden text becaus | [Show] |   +--------------------+--------+ 4 | Even more text     | [Hide] |   | that's wrapped     |        |   | because the state  |        |   | is SHOW.           |        |   +--------------------+--------+ 

    Then in your VBA code, you can still set the row height of Bx (since it affects the whole row) and you won’t care what has been place in the B-column cell – the A-column cell value will be left untouched.

    Or, if you are using column B for something, link it to ZZx (or IVx or whatever the rightmost column is in a row).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: This isn't happening because of the ajax call. I changed it to use
Edit: This problem was down to me passing the wrong view to the Touch
edit This question is solved! Having something weird. I'm using html { font-size: 100%
Edit: this question is outdated. The jsonlite package flattens automatically. I am dealing with
EDIT: This post was originally specific to ASP.NET, but after thinking about it I'm
Edit This question has gone through a few iterations by now, so feel free
EDIT: This question is a duplicate of What is the difference between managed and
EDIT: This issue is already submitted on Github. Changing the Act part to this
[Edit: This problem applies only to 32-bit systems. If your computer, your OS and
EDIT: This problem has been solved. See below. Hey all. I'm building an iPhone

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.