Format Painter Macro

njadam

New Member
Joined
Dec 7, 2014
Messages
6
Hello,

I am trying to develop a macro that copies the format of a cell and allows me to paste it into another for example;

If the text in cell A1 is bold and italicized I would like to press control+c when in cell A1 to copy the format of the cell and then press ctrl+shift+a when in cell B1 and make the non bolded and non italicized text bold and italicized.

Is this possible?

Thank you so much!

Adam
 
Last edited:

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Re: Help - Format Painter Macro

Did you only want to copy Bold and Italicized?

Are you aware of Format Painter in the Home tab?
 
Upvote 0
Re: Help - Format Painter Macro

No, that was an example. It could be to copy the font color or any type of formatting as well. Essentially I can a macro that will grab by pressing ctrl+c the formatting from a cell and allow me to apply it to any cell I go over such as cell AA535. My hope is this macro will allow me to quickly copy and paste a format instead of having to do a few quick keys.

Does this make sense?

Adam
 
Upvote 0
Re: Help - Format Painter Macro

Also, I am aware of format painter bit would rather have a quick ctrl+c to copy the format and then ctrl+shift+z to paste the format
 
Upvote 0
Re: Help - Format Painter Macro

How's this?

You select a cell, it copies the format, then asks you to select a range to paste it in.

You can assign shortcuts in Developer>Macros>Options

Code:
Sub CopyFormat()


Dim Rng1 As Range
Dim Rng2 As Range
    
    Set Rng1 = ActiveCell
    Set Rng2 = Application.InputBox("select cell", Type:=8)
    
    Rng1.Copy
    Rng2.PasteSpecial Paste:=xlPasteFormats
    Application.CutCopyMode = False
    
    
End Sub
 
Upvote 0
Re: Help - Format Painter Macro

How's this?

You select a cell, it copies the format, then asks you to select a range to paste it in.

You can assign shortcuts in Developer>Macros>Options

Code:
Sub CopyFormat()


Dim Rng1 As Range
Dim Rng2 As Range
    
    Set Rng1 = ActiveCell
    Set Rng2 = Application.InputBox("select cell", Type:=8)
    
    Rng1.Copy
    Rng2.PasteSpecial Paste:=xlPasteFormats
    Application.CutCopyMode = False
    
    
End Sub


Hello, thank you so much for having a look at this. I tried the macro you wrote and it's almost there but what I want to do is press ctrl+c to copy the format of a cell and then when i navigate to another cell press ctrl+shift+z and past the format of the copied cell onto that one. Does that make sense?

Thank you so much for your help!
 
Upvote 0
This makes sense all of a sudden, sorry for the delay and confusion.

Again, just assign ctrl+shft+V in Developer>Macros>Options

Code:
Sub PasteFormat()


    Selection.PasteSpecial Paste:=xlPasteFormats


End Sub
 
Upvote 0
This makes sense all of a sudden, sorry for the delay and confusion.

Again, just assign ctrl+shft+V in Developer>Macros>Options

Code:
Sub PasteFormat()


    Selection.PasteSpecial Paste:=xlPasteFormats


End Sub




it works! How can i buy you a virtual beer?
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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