set properties on Excel file programatically from Access

  • Thread starter Thread starter Sam
  • Start date Start date
S

Sam

Hi folks,

take the following code as an example:

' this places a value in the cell (x,y)
mysheet.cells(x,y).Value = CurrentValue

' this sets the font for cell (x,y) to bold
mysheet.cells(x,y).Font.Bold = True

now ive had a search about online but what i cant find is a wat to
resize the cells, using a similar technique as above. i want to widen
my cells, or auto widen them to fit the value inside ( the equivelant
of if you were in excell and you double clikc a cell border: it grows
or shrinks to fit length of text ).

Many thanks,

Sam
 
Cells don't get wider, Columns do:

Workbooks("USData.xls").Sheets("SmallLookups").Columns("X").AutoFit

HTH,
 
Back
Top