View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Formatting Excel worskheet

I take it that it is only in row 6 that you are doing this
routine, and that the merged cells contain some text as
headings. If so then find the last column with text, then
run a loop routine to merge the cells by:

ActiveSheet.Range("IV3").Select
Selection.End(xlToLeft).Select
col = ActiveCell.Column 'returns the column reference for
the last column with text.
For i = 1 To col
With ActiveSheet
.Range(.Cells(3, i), .Cells(6, i)).Select
End With
With Selection
.MergeCells = True
End With

Next i

BOL
DavidC
-----Original Message-----
I want to format a worksheet that merges cells A3 to A6
then borders A3 to A6 and then go accross to G3,G6. Iwant
this to loop through unitl EOF
.