Formatting while inserting Rows

LostinExcelHelp

New Member
Joined
Jun 9, 2023
Messages
16
Office Version
  1. 365
Platform
  1. Windows
I am inserting rows with Ctrl+Shift++

Then the format painter icon hovers and i can click on it to choose whether i want ‘format same as above’ and ‘format same as below’.

I want to choose that format painter with a keyboard shortcut instead of a mouse click. Is it possible?
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Hi LostinExcelHelp

Do you know about VBA?
I propose to use Record Macro to get what you desired. Go to excel, save the excel as xlsm (macro-enabled), go to Developer tab, click Record Macro. Then do whatever your procedure required.
Then check out the code in the VBA script - Module1. You edit the code as you like.

Below is what I get when doing the row insertion + 'format same as above'
VBA Code:
Sub FormatasAbove()

ActiveCell.EntireRow.Select
    Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove

End Sub

To make this macro auto-run on keyboard shortcut, please click Macros, or press Alt+F8
1714630626845.png


Then select the macro name and choose option:
1714630681557.png


Then choose a keyboard shortcut: (Note: All the Ctrl shortcuts are occupied. You can use Ctrl + Shift + your alpha character. Just press the Shift key when you click into that tiny box)
1714630953389.png


Hope this helped.
Thanks
 

Attachments

  • 1714630774331.png
    1714630774331.png
    5.8 KB · Views: 1
Upvote 0
Hi, thanks for the detailed suggestion! I was wondering if there’s any shortcut to it instead of having to use macros!
 
Upvote 0
Press ALT, H, F, and P takes you to the regular format painter but I don't think you can get the format from above from there
 
Upvote 1

Forum statistics

Threads
1,216,085
Messages
6,128,733
Members
449,465
Latest member
TAKLAM

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