Hi I want to format a range of cells in VBA, but I dont know how to go about it! I need to format coloums A to I from row 8 onwards. I wnat to apply a shading format to every other row. Is this possible? Many thanks
Hi I want to format a range of cells in VBA, but I dont know how to go about it! I need to format coloums A to I from row 8 onwards. I wnat to apply a shading format to every other row. Is this possible? Many thanks
Use conditional formatting. See http://www.xldynamic.com/source/xld.CF.html#rows
OK but how do I apply that in a VBA enviroment
You don't need to.
The problem is that the sheet is getting populated from another worksheet and it copys the rows straight in, including any row striping. Because it dosent copy all rows. just the ones that I want, I finish up with some consecutive row shading.
I was thinking that if it was coded for the formating to happen after I had inserted the rows (via a button on the first sheet) then that would correct it.
Please Login or Register to view this content.
Bob thanks for your help so far but where do I insert this please? This is my code that I am using to update my sheet: Note: I just coipied the code that you had written anfd then added the 'ProcessData' at the end of my code!
Please Login or Register to view this content.
Last edited by dadrew; 09-05-2012 at 09:02 AM.
I think this should do it
Please Login or Register to view this content.
BTW, you are just 45 miles up the road from me.
Got an error on the lineCompile error: For control variable already in use.Please Login or Register to view this content.
Sorry, sloppy
Please Login or Register to view this content.
Thats cool the only problem is, is that it odes the whole row, whereas I only need it up to coloum "L". Apart from that it works well!
Please Login or Register to view this content.
Hi Bob, worked a treat once I had reaised that I had given you incorrect information Doh!! I told you it needed to start at line 8 and it was actually line 3!
I now need to format the borders, double lines around the outside of the range and single lines for the cells themslves.
Last edited by dadrew; 09-05-2012 at 05:27 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks