the excel sheets are done one at a time, they are invoices that the customer sends into a company, and they required this cell format in several individual cells but thay are in different colums and on different rows.
I do have another query, is it possible to highlight a block of cells, say b1 and b2, c1 and c2 and then draw a border around them. I played about with it but it never worked for me and i'm not sure if this functionality is available through ole.
~M
>You're welcome.
>If you're doing that in a loop, keep in mind it'd be slower. Instead you might get whole column/row/area references and do just one call. ie: To apply to only Column 2 ("B") in whole sheet used area:
>
>oleapp.activeworkbook.activesheet.UsedRange.Columns(2).NumberFormat = ...
>
>Cetin
>
>>tested, tried and trusted:) thanks Cetin, that was perfect.
>>~M
>>
>>>Mark,
>>>OleApp.cells.NumberFormat
>>>
>>>OleApp.cells means all cells.
>>>
>>>Instead of:
>>>>
>>>>OleApp.cells(lnCounter,3).Select
>>>>OleApp.cells.NumberFormat = "[$€-2] #,##0.00"
>>>>
>>>Try:
>>>
>>> OleApp.cells(lnCounter,3).NumberFormat = "[$€-2] #,##0.00"
>>>
Cetin
>>>
>SNIP...
Go raibh maith agat
~M