• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to expand both rows and columns at same time?

hi,


I have a file where I have to expand rows and columns..i use shortcuts-ALT+O+C+A (for columns)


ALT+O+R+A( FOR ROWS)


is there any way/key combination where I can expand both rows and columns at same time
 
Hi, shankar_iyer83!

I use a non english Excel version, so our shortcuts differ. What do you mean with expand? Resizing to fit the contents or anything else?

Sorry for the inconvenience.

Regards!
 
Hi, shankar_iyer83!


I don't know a shortcut or a method that does that, but you can workaround it with one click and two double clicks:


- Click on the little rectangle upper/left A1 cell (this selects whole sheet)

- Double click in the separation of two column headers, where the arrow down mouse icon changes to a vertical bar with two lateral arrows (this will adjust column widths)

- Double click in the separation of two row headers, where the arrow right mouse icon changes to a horizontal bar with two upper/lower arrows (this will adjust row heights)


Otherwise you should use VBA code and perform that within a macro. But considering the input operations (clicks vs shortcuts or macro calls Alt-F8/select/run), I think clicks is the more ergonomic and lazy method.


Regards!
 
thanks sirjb7,


I checked out..the shorcut command is less time consuming..than clicks..between ..can u share the macro/vba code for this.I dont know excel vba/macros..will use it and then check which is faster!
 
Expanding on SirJB7's idea, here what the macro would look like:

[pre]
Code:
Sub AutoFitAll()
Selection.Columns.AutoFit
Selection.Rows.AutoFit
End Sub
[/pre]
You could then give it a hotkey...if you really use it a lot, you could even put it in your Personal.xls workbook so that it's always available. For instance, I have a macro to toggle AutoFilter on/off assigned to Ctrl+Shift+f and Paste Values assigned to Ctrl+Shift+v just because I use them all the time.


To assign a hotkey, pull up the Macro menu (Alt+F8), then select macro, options.
 
Hi, shankar_iyer83!


This is the code:

-----

[pre]
Code:
Option Explicit

Sub AutoFitAll()
With Cells
.Select
.EntireColumn.AutoFit
.EntireRow.AutoFit
End With
Range("A1").Select
End Sub
[/pre]
-----


Regards!
 
@Luke M

Hi!

Sorry I didn't read your post... maybe something distracted myself and I answered late after begining to respond ... toooo late :)

Regards!
 
Hi, shankar_iyer83!

Take any of the codes, copy, go to Excel, open desired file, press Alt-F11, Insert, Module, and paste in the upper right panel.

Then back to Excel sheet, Alt-F8, select macro name, execute/run.

Regards!
 
thanks sirjb7,


it worked, just tell one more thing..is there any way if I can remember short cut assigned keys on tool bar or some link is shown for shortcut keys of a particular macros?
 
Not completely sure what all you're asking, but

a) you could assign the macro to a button on toolbar

b) you could assign macro to a command button on worksheet

c) you can just use the keyboard shortcut

d) if you forget keyboard shortcut, open macro menu, select macro, goto Options


Hopefully one of those answers your question.
 
Not completely sure what all you're asking, but

a) you could assign the macro to a button on toolbar

b) you could assign macro to a command button on worksheet

c) you can just use the keyboard shortcut

d) if you forget keyboard shortcut, open macro menu, select macro, goto Options


Hopefully one of those answers your question.
 
Back
Top