How to transfer cell colors and formats using "With" statements?

chuckchuckit

Well-known Member
Joined
Sep 18, 2010
Messages
541
Here is "With" code that transfers data:
Code:
[COLOR=black][FONT=Verdana]With Range("A1:B2")<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>[/FONT][/COLOR]
[COLOR=black][FONT=Verdana]   Range("D5").Resize(.Rows.Count, .Columns.Count) = .Value<o:p></o:p>[/FONT][/COLOR]
[COLOR=black][FONT=Verdana]End With<o:p></o:p>[/FONT][/COLOR]
It does not transfer cell colors, fonts, row heights, or column widths etc. How would I modify (or add to) the above code to transfer such without using the "copy" command?

Am trying to avoid using the clipboard, which the "copy" command uses.

Thanks.

Chuck<o:p></o:p>
<o:p></o:p>
 
Can't seem to get it to work for more than one cell at a time, as it seems to combine different cell attributes in ranges.

But you got me in the right direction where I now can apply everything to a cell and just loop through cells if needed.

Unless I missed something.

Thanks again John

Chuck
 
Upvote 0

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Forum statistics

Threads
1,224,609
Messages
6,179,875
Members
452,949
Latest member
Dupuhini

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