Excel Tips - Autofit Row Height to Cell Contents | Auto Text Wrap | Easy Method
ฝัง
- เผยแพร่เมื่อ 17 ก.ย. 2023
- Hey team,
In this quick video I will show you how to set up Excel so that it automatically adjusts row height to match the content size in your cell based on what you entered.
I was searching this video for quite a few days. It works. Thanks 👍
Thank you so much!
A great tip. First time I've added code. Thank you
Thank you for watching =)
Wow - thanks - really easy to follow and it works. Many thanks, much appreciated
Thank you!
I noticed that this does not work if the rows are merged
This worked great. Thank you!
Thank you so much!
I was searching this video for quite a few days. It works. Thanks
Thank you so much!
But changing column size not change row size.
@@jayani923 Are you looking for a way to auto-adjust the column size?
Thank you! I just subbed and turned on notifications. Everyone else was yapping on TH-cam but you have the solution!
Thank you!
I agree!
@@luisreyes9568 thank you =)
Thank you! This saved me sooo much time
Thank you so much for the comment =)
it works. thanks.
@@shahnawazabbasi6911 Thank you so much as well =)
How can I make the text inside the squares be aligned to the top as well? Right now they all align to the bottom. Edit: you type in: Cells.VerticalAlignment = xlTop
Any thoughts on how to accomplish this with two merged cells and only apply it to a row with specific text? My example is at the bottom of my invoice I have Terms of Service: in order for my terms of service to fit I have merged to columns in that row. I will add and delete rows above the terms of service as I add products or delete products from my invoice. I also adjust the terms of service based on each client. It is a royal pain to manually adjust the terms of service row each time I create an invoice. Would love to know your thoughts.
Let me research and get back to you =)
@@CareerSolutionsforToday I kind of found a work around by selecting the rows and columns for the size I need the text box to be, then format cells all the selected cells, under Alignment set as Left (Indent) for Horizontal and Vertical Alignment set as Center. Text Control check the boxes for Wrap Text and Merge Cells. I still have to double click between the row numbers of the first merged row but it does fit the text very well. If I have to add more text I find that adding a row in the middle of my merged rows helps to keep the text looking nicely. Not perfect but it is a work-around. Would love to know if you find something that does autofit. Thanks!
thanks for the video, my issue is after I autofit and closed excel if I come back its not organized. I want to open the excel file and have it already locked so i dont have to autofit everytime i open the file, can you tell me how to do that. Thank you
Hey there, so is it that you want the code to run only when you select it?
Thank you! Is there a way to apply this only to a certain range?
Thank you so much for the comment. You can apply this to just a certain range by changing the code a bit. For example, if I want the VBA to only apply to cells A1:B100 you could use the code below:
Set Rng = Range("A1:B100")
Rng.Cells.WrapText = True
Rng.EntireRow.AutoFit
Let me know if this helps =)
@@CareerSolutionsforToday Perfect! Thanks!
@@totisause Thank you as well, have a great Sunday =)
How would you do this on Excel in sharepoint? There isn't a "view code" option when right clicking the tab.
Hey there and thank you for the comment. So you cannot create or edit macros in Excel online but you can create macros in the app version and then transfer them.
Does this work for merged cells?
Hey there, from what I read it will not. I have to reaearch how to adjust for merged cells.
I took time to read the comments and I must commend you for engaging all the comments with a response. Thank you.
However I will like to reiterate "the problem with Copy paste data from one cell to another)
Have you found the solution?
Hey there, sorry for my delay. Still haven't found the reason or workaround for this. I will let you know if I uncover anything. I hope you have a great weekend =)
Windows 11 doesnt have view code pls explain
Hey there, the view code shows up when you right click the tab you are on in Excel, not in windows 11. Let me know if this helps.
Once we added this code, we can not copy paste data from one cell to another. Please help.
Hello, you are correct that seems to be a limitation. I will work on seeing if there is any workaround and let you know =)
You can still copy-paste if you use the web-version (not the app version)
When I right clock the sheet. View code is not an option
@@pauljohnson8921 Are you using the application version of Excel or the web version?
Is there a way to turn this OFF? It personally drives me insane when dealing with a QBO report or bank feed where transactions tend to have a really long memo and excel taking it upon itself to adjust the row height to display the memo. I literally never want this to happen, and if I do find myself wanting it to happen, I'll adjust for that case. But default, I want Excel to never ever change my row height unless I tell it to.
Hey there. so one way to stop this would be to manually adjust the row heights even once. If you click the number 1 and use Ctrl + Shift + Down to get to the bottom, you can extend the rows to a certain height (even the same as before by changing it back). Doing this will lock the row height until you change it. Let me know if this helps =)
@@CareerSolutionsforToday Thanks for the reply! So basically any worksheet I'm ever in, I need to preemptively set the row height so that Excel never auto adjusts?
@@justin3132 That would be a way yes, from what I can see if you are using text wrap, Excel will always force the rows to increase unless you change the size manually. A bit of a pain, but the quick adjustment will keep them from expanding. Hopefully the tip I shared helps for doing them all at once too.
@@CareerSolutionsforToday Auto height adjustment for excel option was something we exposed earlier. Hence its a painfull when its not happening now
This isn't working for me. In fact, if I do Cell Styles > AutoFit Row Height, the cell adjusts and then REVERTS to the way it was. Help!
Hey there, I am sorry to hear that. Not sure why that would be happening. What happens when you try the VBA solution?
@@CareerSolutionsforToday Unfortunately, nothing happens. The autofit reverts as soon as I leave the cell.
It dint help my problem.
Hey there, you had the question about merged cells correct? I am looking into this and will try to get back to you. I have tested some VBA options but cannot get them to work just yet.
Not working. Not at all
Sorry to hear that. Let me know if there is a part of the video you are maybe having trouble with. I have tested this many times to make sure it works. Maybe a step is missing?
Let me know and hope you have a great day.