View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
galimi galimi is offline
external usenet poster
 
Posts: 210
Default Cell Formatting Issue

Henry,

I would change the code to something like this

set rng=Range("D6:D555").Select

for each cl in rng
if not rng.mergecells then
Selection.NumberFormat = "0.0000"
end if
next

This will skip the mergecell selections. You can expand on this code to
determine if the cell selected within the merge cell is NOT your heading and
then format that appropriately.
--
http://HelpExcel.com




"Henry Jones" wrote:

On my worksheet (Excel 2003), I am using the following code to format:

Range("D6:D555").Select
Selection.NumberFormat = "0.0000"


The problem is every 40 or so cells I have merged 5 rows from A to S. These
are title rows to be printed and the text is centered. It seems that each
cell on the page has been formatted to 0.0000

How can I just format the range D6:D555 without formatting the other cells?

Thanks in advance