you can also try this select the cells in which you want to apply your formatting...
run this code below =================================================== Sub ApplyMyFormat() With Selection.Interior .Pattern = xlSolid .PatternColorIndex = xlAutomatic .ThemeColor = xlThemeColorAccent6 .TintAndShade = -0.249977111117893 .PatternTintAndShade = 0 End With With Selection.Font .ThemeColor = xlThemeColorLight1 .TintAndShade = 0.349986266670736 End With End Sub =================================================== this could apply a particular format to your cell... now you can change the values to suit your format. if you want to know code for specific format, then please let me know.. if possible apply the desired format in a spreadsheet to a cell, and mail the file. Regards, Vivek Agrawal Contact No. +91-9999-154-077 Skype ID - vivek.agrawal83 GoogleMoonlight.com - Saving energy-Save Earth On Mon, Jul 6, 2009 at 10:34 PM, tushar patki <tusharpa...@gmail.com> wrote: > Dear All, > > I have written a code which will copy cell contents from one cell to > another. Along with the cell contents, also formatting of the cell is > copied. I am not able to code and keep the formatting as I want. For eg. > > Cell A1 has color yellow. > I copied cell A1 to B1. > > The color also gets copied. Please tell me the code which will again retain > the white colour again. > > I tried with RGB function, also with interior property, but I am unable to > do the same. Pl guide me. > > > -- > Regards > Tushar S Patki > CA > Contact Details - > 2106, Sadashiv Peth, > Dattaprasad Apartment, > Pune - 411030. > State: Maharashtra > Country: India > Phone - +91-020-24337003 > Mobile - 09850715116 > > > > --~--~---------~--~----~------------~-------~--~----~ ---------------------------------------------------------------------------------- Some important links for excel users: 1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at http://www.excelitems.com 2. Excel tutorials at http://www.excel-macros.blogspot.com 3. Learn VBA Macros at http://www.vbamacros.blogspot.com 4. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com If you find any spam message in the group, please send an email to: Ayush Jain @ jainayus...@gmail.com or Ashish Jain @ 26may.1...@gmail.com <><><><><><><><><><><><><><><><><><><><><><> HELP US GROW !! We reach over 5,000 subscribers worldwide and receive many nice notes about the learning and support from the group. Our goal is to have 10,000 subscribers by the end of 2009. Let friends and co-workers know they can subscribe to group at http://groups.google.com/group/excel-macros/subscribe -~----------~----~----~----~------~----~------~--~---