Hello everyone
I have weird case.. maybe as for me
I have a code that puts some data in cell. The data appears like that
And after I double click into the cell I got
How can I get the output as in the second case directly without having to double-click the cell?
Adjust string ouptut in cell
-
- PlatinumLounger
- Posts: 4931
- Joined: 31 Aug 2016, 09:02
Adjust string ouptut in cell
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 78558
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Adjust string ouptut in cell
I see this when I open the workbook:
The following line will adjust the row height:
The following line will adjust the row height:
Code: Select all
Range("A2").EntireRow.AutoFit
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4931
- Joined: 31 Aug 2016, 09:02
Re: Adjust string ouptut in cell
The row height is already fit. and I tested the line of AutoFit but the same output for me.
Any other ideas?
Is there a code that double clicks the cell ..!!!!!!!!?
Any other ideas?
Is there a code that double clicks the cell ..!!!!!!!!?
-
- Administrator
- Posts: 12618
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: Adjust string ouptut in cell
I see the same as Hans. I just open the workbook and it looks like his screenshot. If I double click the cell there is no noticable change in appearance.
StuartR
-
- PlatinumLounger
- Posts: 4931
- Joined: 31 Aug 2016, 09:02
Re: Adjust string ouptut in cell
Thanks a lot. Maybe this bug in Office 365 !! It is weird for me too
-
- Administrator
- Posts: 78558
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Adjust string ouptut in cell
It's strange - I'm using Excel 2019, which isn't very different from Excel in Office 365...
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4931
- Joined: 31 Aug 2016, 09:02
Re: Adjust string ouptut in cell
But the problem is gone when I double click in the cell. Is there a workaround to double click the cell?
-
- Administrator
- Posts: 78558
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Adjust string ouptut in cell
You could try
SendKeys "{F2}{Enter}"
But that doesn't work for me.
SendKeys "{F2}{Enter}"
But that doesn't work for me.
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4931
- Joined: 31 Aug 2016, 09:02
Re: Adjust string ouptut in cell
This works for me. Thanks a lot
But if there are any other workarounds except using SendKeys, it will be better.
But if there are any other workarounds except using SendKeys, it will be better.
-
- Administrator
- Posts: 78558
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Adjust string ouptut in cell
F2 enters edit mode. This is not available in VBA in a normal way - VBA doesn't work in cell edit mode. So SendKeys is the only workaround.
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4931
- Joined: 31 Aug 2016, 09:02
Re: Adjust string ouptut in cell
I thought of using Text To Columns method and I tried several tries but with no use.