Hi
I'm a beginner at this stuff so please be patient, have exported a table using copyfromrecordset into excel setting variables:
Dim objExcel As Excel.Application
Dim objDAORsData As DAO.Recordset
dim r as range
'when table is copied go onto do various formatting
With objExcel 'various formatting
.Columns.AutoFit 'etc
'but column 3 contains numbers which i want to format = "#,##0" while number of rows varies for each sheet & each time its exported so was trying to use.......
Set r = Range("c3")
.Range(r, r.End(xlDown)).Select
.Selection.NumberFormat = "#,##0"
...but doesn't work. I think i should be passing an address to the range object & also can i use this .range within the With objexcel.
Your help is much appreciated.
Thanks.
I'm a beginner at this stuff so please be patient, have exported a table using copyfromrecordset into excel setting variables:
Dim objExcel As Excel.Application
Dim objDAORsData As DAO.Recordset
dim r as range
'when table is copied go onto do various formatting
With objExcel 'various formatting
.Columns.AutoFit 'etc
'but column 3 contains numbers which i want to format = "#,##0" while number of rows varies for each sheet & each time its exported so was trying to use.......
Set r = Range("c3")
.Range(r, r.End(xlDown)).Select
.Selection.NumberFormat = "#,##0"
...but doesn't work. I think i should be passing an address to the range object & also can i use this .range within the With objexcel.
Your help is much appreciated.
Thanks.