What sort of formatting do you mean? The basic code would be something
like
Dim RangeToFormat As Excel.Range
Dim WS As Excel.Worksheet
RangeToFormat = DirectCast( _
XLApp.Workbooks("Book1.xls"). _
Worksheets.Item("Sheet1"), Excel.Worksheet). _
Range("A1").EntireColumn
WS = RangeToFormat.Worksheet
RangeToFormat = _
XLApp.Intersect(WS.UsedRange, RangeToFormat)
RangeToFormat.Font.Bold = True
This sets the variable RangeToFormat to that portion of column F that
resides within the used range of the worksheet "Sheet1" in workbook
"Book1.xls". Once it has that range object, it applies a Bold format
to the text font. If your module uses Option Strict On (and you should
be doing that), you need the DirectCast on the worksheet. If you have
Option Strict Off in effect, you don't need the DirectCast.
If this code does not suffice, please post back with much more detail
about what you are trying to do, the code you have now that doesn't
work, and an explanation of what you want to accomplish.
Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]