suppose the cell which has format is G1 and the cell to which this format is to be changed is C1.
now open vbeditor
hit control+R
you get project window on the left containing all the open workbooks
goto this particular workbook and under this right click "thisworkbook" (if necesary click the minus sign on the left of the workbook name)
clcik view code
in the window that comes up copy this EVENT CODE
Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Range("G1").Copy
Range("c1").PasteSpecial Paste:=xlPasteFormats
End Sub
(MODIFY the code to suit you)
now change the format of G1 to whatever you want
hit control+S to save the file
C1 also will change to the same format as in G1
Okay, it works from a template BUT, each time I save it goes to the target cells. Is there a way for it to position to cell A1 after it changes the formatting of the target cells?
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.