setting a custom format to a cell within a macro

etpeterson

New Member
Joined
Jan 19, 2005
Messages
18
I have a cell in one worksheet that I am copying to many different worksheets. I can copy the formula in the target cell, but it doen't show up correctly because the cell that is being copied has a custom date format. How do I copy the format from within the subroutine as well.

Eric
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
This should get you going in the right direction:
Range("a").copy
Range("x").PasteSpecial Paste:=xlFormats
 
Upvote 0
Close. Very close.
Worksheets("Sheet1").Range("B10").Copy
ActiveSheet.Range("I24").PasteSpecial Paste:=xlFormats[/face]
Those are the lines I put it, but it gives me a complie error Expected:End of statement at [/face]. What do I have wrong with my syntax?

Thanks,
Eric
 
Upvote 0

Forum statistics

Threads
1,203,460
Messages
6,055,556
Members
444,796
Latest member
18ecooley

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