Adjust column width when column header is hidden

yitzymerm

New Member
Joined
Jul 7, 2022
Messages
14
Office Version
  1. 365
Platform
  1. Windows
Can you adjust column width if the Column (ABC) heading is hidden (I can't get that plus symbol that's usually used to adjust column size) and same goes for the rows (123)....

I know I can unhide the headings, my question is if there's any way to do it while keeping them hidden.

Thanks
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Is this what you mean?

1690942638145.png



Another option
Ctrl+Space bar to select column, right click & choose Column Width ...
 
Upvote 0
I guess that could work, was just looking more for something that I can quickly adjust width based on length of characters in the cell, which regularly we would just double click on top between the 2 columns.

Thanks.
 
Upvote 0
I guess that could work, was just looking more for something that I can quickly adjust width based on length of characters in the cell, which regularly we would just double click on top between the 2 columns.

Thanks.
There are a number of ways to do this with vba. For example, you can attach the following code line to a button Selection.EntireColumn.AutoFit or use the OnKey Method to assign the macro to some keyboar shortcut keys.

or you could still use the mouse.

For example, the following code goes in the ThisWorkbook Module and it will autofit the row(s) and column(s) of the current selection when holding down the CTRL key and right-clicking the mouse:
VBA Code:
Option Explicit

#If VBA7 Then
    Private Declare PtrSafe Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
#Else
    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
#End If

Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
    If GetAsyncKeyState(VBA.vbKeyControl) Then
        Cancel = True
        Selection.EntireColumn.AutoFit
        Selection.EntireRow.AutoFit
        Exit Sub
    End If
End Sub
 
Upvote 0
I guess that could work, was just looking more for something that I can quickly adjust width based on length of characters in the cell, which regularly we would just double click on top between the 2 columns.
Well, with my first example above, after Ctr+Spacebar you could choose AutoFit Column Width instead of the option I highlighted.

Another alternative would be keyboard shortcut: Ctrl+Spacebar then Alt+H O I
 
Upvote 0

Forum statistics

Threads
1,223,240
Messages
6,170,951
Members
452,368
Latest member
jayp2104

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top