Forum Discussion
gunner-b
Nov 20, 2021Copper Contributor
Autofit Row Height when sorting
When a worksheet contains rows with different heights, I would expect those heights to be automatically adjusted during a sort of the rows in that sheet. Alas, this appears to not be the case (At le...
NikolinoDE
Nov 20, 2021Gold Contributor
You can manually adjust the column width or row height or automatically resize columns and rows to fit the data.
Change the column width or row height in Excel
Additional Information:
Change the column width and row height
Hope I was able to help you with this info.
NikolinoDE
I know I don't know anything (Socrates)
- gunner-bNov 20, 2021Copper ContributorThanks for your help. I guess I'm just to lazy to want to do it manually.
- NikolinoDENov 20, 2021Gold Contributor
Here automatic adjustment with VBA on all cells
See the attached file with examples where you can try it out yourself.Enjoy excel
- deniserTHFeb 06, 2022Copper Contributor
Hello Niko...
Your example file below is exactly what I'm trying to do. But apparently I'm not be doing the VBA correctly, because it's not working for me either. I even tried copying your code exactly, but it didn't do a thing. (I've attached your example to clarify what I'm referring to.)
Zeilen_Spalten_auto_VBA.xlsmPreview file20 KBI resorted to creating a Macro/Button, but I'd rather it be done just as you have in your example, "Autofit Automatically". I was even able to use your example and I added Data/Filter/Sort, and even after sorting, it still works!If there are some specific steps to this VBA Code, I'd be most interested.