Copy_past _xlormat

T

Titoun

Dear Receiver, (I'm just started with VBA..)

I am trying to copy the format (font, interior and value)
of a cell to another by a VBA function.
The below Sub is working well but I need it under
function. Did you have any idea on how correct the below
function or did you have another one in stock.

Sub Copy_Format_And_Value_Of_One_Cell_In_Active_Cell()
Rng = InputBox("Adresse of the cell", "Copy Formats")
Range(Rng).Copy
ActiveCell.PasteSpecial Paste:=xlFormats
ActiveCell.Value = Range(Rng)
Application.CutCopyMode = False
End Sub


Function Cop_Form(InRange As Range)
For Each cellule In InRange
Range(cellule).Copy
ActiveCell.PasteSpecial Paste:=xlFormats
ActiveCell.Value = Range(cellule)
Application.CutCopyMode = False
Next cellule
End Function

Thanks in advance for your great help.
Titoun
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top