Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Auto Row Height in Table

0

Thank you Mr. John_Ru! 

It worked, I should have known how to do that.

However, now the other rows are scrunched and it's difficult to read.  See  attached actual file I'm using with data replaced with junk.  

================================================

Re-stating the question with an example file.

I've attached a file with a Table.  

Sorting will occur on either First or Last columns.

I need to see the entire text in the Comment column in the Chris Little row, no matter how the table is sorted.  

Initially the Chris Little row is in Excel row 10 with a row height of 42.  However, when resorted by First, the Chris Little row ends up in Excel row 11 with row height 20 and the text in the Comment column cannot be read.  Is there a way that wherever the Chris Little row lands upon re-sort, the row height does not change?

The example is very simple, the data I want to apply this concept to has many more rows where I want to maintain the original row height.

I hope this time this makes more sense!

Thanks.

Answer
Discuss

Discussion

Susan

Sorry but your question doesn't make too much sense to me. I've provided an Answer but if that doesn't solve your problem, please edit your original question and use the Add Files... button to upload a representative Excel file (without any personal data) to show your existing data (and any macros). Then we should be able to give specific help.
John_Ru (rep: 6142) Jul 19, '23 at 2:34 am
See restated question with file
SusanUser (rep: 16) Jul 19, '23 at 11:40 am
Please see my new Answer
John_Ru (rep: 6142) Jul 19, '23 at 2:44 pm
Susan. Please see my revised Answer and second file. Next time, please give a respresentative file with your original question- it's not fair to expect three versions of the answer!

Also, please don't use my Forum name in your question (even to thank me!), questions should be open to anyone to answer (though it's nearly always Willie or me)
John_Ru (rep: 6142) Jul 21, '23 at 1:46 pm
Add to Discussion

Answers

0
Selected Answer

Susan

Thanks for uploading a (first) file.

To keep the larger comment visible, you just need to set Autofit on the rows of your table, as follows:

  1. Select the rows of your table*.
  2. On the ribbon, go .Home / Cells / Format then
  3. Click Autofit Row Height..

Now when you sort by anything, the row with the larger comment will be displayed in full anyway.

The first revised file attached has that done and is sorted by Last, Z to A.

(* While you have that selected, personally I would also set the cell vertical alignment to Top on Home / Alignment- the default of Bottom might be fine for Accountants but just feels odd to me with text!) 

Revision 21 July 2023

Susan- now you replaced the first file with a quite different one,  youi've commneted autofit deep row make others "look scrunched". That kind of inevitable if there's a great disparity between the length of your Notes column and data in other columns.

Without using VBA (e.g. to adjust the font size for verbose cells), if you want to increase the overall legibility of your data, you can do three things (done in the second revised file below):

  • Select columns A-G of your table ONLY, autofit the widths - on the ribbon, go .Home / Cells / Format then Click Autofit Column Width (some of your columns will shrink but the headers might still leave them too wide- you might add returns in the longer headers so their width is reduced e.g. see column B, which is now:
Price
Effective
Date
  • Use the width saved to expand column H (Notes). For the non-blank entries (including your nonsense data), the average length is about 58 characters (with 271 in the longest). I've set it for about 90 on average
  • Limit what a user can enter in that column using data validation- I've used that in cell H8 so users can't use more than 150 characters and can't use returns in the cell (which could make very deep cells)- the Custom data validation formula used is:
=AND(ISERROR(FIND(CHAR(10),H8)), LEN(H8)<=150)
which triggers an error if the user includes a return or exceeds 150 characters in H8. I then used PasteSpecial/ Validation to apply that to other cells in that table column.

The latter doesn't fix existing entries but Excel can show you the offending ones- go riibbon Data/ Data Tools/ Data Validation (icon with green tick/check and red stop sign) then click Circle Invalid Data. Cell H36 (e.g.) will then show a red ellipse. If you go to that cell and try to re-enter the same text, you'll get an error.

Note that as you add to the table, that data validation will be added to each now row.

Hope this fixes your problem. If so, please remember to mark this Answer as Selected.

Discuss

Discussion

Glad that worked for you. Thanks for selecting my Answer, Susan. 
John_Ru (rep: 6142) Jul 24, '23 at 12:00 pm
Add to Discussion


Answer the Question

You must create an account to use the forum. Create an Account or Login