Olavfinnerud
New Member
- Joined
- Jun 7, 2022
- Messages
- 16
- Office Version
- 2021
- Platform
- Windows
Hi,
I have a problem with the text in the first row, i want to be able to write longer words/sentences in the cell and have the cell expand with the text so it fits in the column. I have tried for some hours now and cant find a solution that works. So when i press the button and add a new column i want to be able to write longer words than "Annleggsleder" and have the column expand to fit the text in the cell. The code i have for the button to add a new column is:
Sub Macro2()
Range("C6:C17").Copy
Cells(6, Columns.Count).End(xlToLeft).Offset(0, 1).Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub
- I have attached a picture of the worksheet
I have a problem with the text in the first row, i want to be able to write longer words/sentences in the cell and have the cell expand with the text so it fits in the column. I have tried for some hours now and cant find a solution that works. So when i press the button and add a new column i want to be able to write longer words than "Annleggsleder" and have the column expand to fit the text in the cell. The code i have for the button to add a new column is:
Sub Macro2()
Range("C6:C17").Copy
Cells(6, Columns.Count).End(xlToLeft).Offset(0, 1).Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub
- I have attached a picture of the worksheet