Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default automation of formatting

Hi! I want to format my excel data that's been imported from MS Access, such
that, ther's a box around all the data cells, also please help me, about how
to have my aggregate fields at the end of the data. Can this be achieved
using MS Excel 2007, automation using macros, or VBA. I'd much appreciate
your guiding remarks. Thanks in advance.
Regards,
Imran.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default automation of formatting

both can be done quite easily...but we'd need to see the code that loads the
sheet with the MS Access data to get a handle on the method used in order to
give you an appropriate response.

for example you may have
Range("A1").CopyFromrecordset rst
or various other methods of loading the data to the sheet.



"Imran Ghani" wrote in message
...
Hi! I want to format my excel data that's been imported from MS Access,
such
that, ther's a box around all the data cells, also please help me, about
how
to have my aggregate fields at the end of the data. Can this be achieved
using MS Excel 2007, automation using macros, or VBA. I'd much appreciate
your guiding remarks. Thanks in advance.
Regards,
Imran.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default automation of formatting


Hi Patrick Molloy

I am exporting my data with a query as:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "qryinvrgstr",
"d:\invoice register.xls", True

Its working fine and exporting the data ok, but I'd like also to get totals
in the end of the data and also to format my whole data with lines all
around. I'd much appreciate your guidance.

Regards,
Imran.

"Patrick Molloy" wrote:

both can be done quite easily...but we'd need to see the code that loads the
sheet with the MS Access data to get a handle on the method used in order to
give you an appropriate response.

for example you may have
Range("A1").CopyFromrecordset rst
or various other methods of loading the data to the sheet.



"Imran Ghani" wrote in message
...
Hi! I want to format my excel data that's been imported from MS Access,
such
that, ther's a box around all the data cells, also please help me, about
how
to have my aggregate fields at the end of the data. Can this be achieved
using MS Excel 2007, automation using macros, or VBA. I'd much appreciate
your guiding remarks. Thanks in advance.
Regards,
Imran.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default automation of formatting

ah. from your question I thought Excel was driving the import, but in fact
MS Access is doing this..so AFAIK you can't format this way, you'd have to
write more VBA in Access to open the spreadsheet then format it. I don't
think Access gives you much control.
What would be "better" is to instantiate excel, load the table from the
query and then you'd have more control over the excel range.
Do you know how to do this?


"Imran Ghani" wrote in message
...
Hi Patrick Molloy

I am exporting my data with a query as:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
"qryinvrgstr",
"d:\invoice register.xls", True

Its working fine and exporting the data ok, but I'd like also to get
totals
in the end of the data and also to format my whole data with lines all
around. I'd much appreciate your guidance.

Regards,
Imran.

"Patrick Molloy" wrote:

both can be done quite easily...but we'd need to see the code that loads
the
sheet with the MS Access data to get a handle on the method used in order
to
give you an appropriate response.

for example you may have
Range("A1").CopyFromrecordset rst
or various other methods of loading the data to the sheet.



"Imran Ghani" wrote in message
...
Hi! I want to format my excel data that's been imported from MS Access,
such
that, ther's a box around all the data cells, also please help me,
about
how
to have my aggregate fields at the end of the data. Can this be
achieved
using MS Excel 2007, automation using macros, or VBA. I'd much
appreciate
your guiding remarks. Thanks in advance.
Regards,
Imran.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default automation of formatting


Hi Patrick Molloy
Thanks for your reply. Kindly do guide me about the whole process, mentioned
by you, as I, being a novice, am certainly not much capable to handle the job
independently. I'd much appreciate your helping hand.
Regards,
Imran.

"Patrick Molloy" wrote:

ah. from your question I thought Excel was driving the import, but in fact
MS Access is doing this..so AFAIK you can't format this way, you'd have to
write more VBA in Access to open the spreadsheet then format it. I don't
think Access gives you much control.
What would be "better" is to instantiate excel, load the table from the
query and then you'd have more control over the excel range.
Do you know how to do this?


"Imran Ghani" wrote in message
...
Hi Patrick Molloy

I am exporting my data with a query as:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
"qryinvrgstr",
"d:\invoice register.xls", True

Its working fine and exporting the data ok, but I'd like also to get
totals
in the end of the data and also to format my whole data with lines all
around. I'd much appreciate your guidance.

Regards,
Imran.

"Patrick Molloy" wrote:

both can be done quite easily...but we'd need to see the code that loads
the
sheet with the MS Access data to get a handle on the method used in order
to
give you an appropriate response.

for example you may have
Range("A1").CopyFromrecordset rst
or various other methods of loading the data to the sheet.



"Imran Ghani" wrote in message
...
Hi! I want to format my excel data that's been imported from MS Access,
such
that, ther's a box around all the data cells, also please help me,
about
how
to have my aggregate fields at the end of the data. Can this be
achieved
using MS Excel 2007, automation using macros, or VBA. I'd much
appreciate
your guiding remarks. Thanks in advance.
Regards,
Imran.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default automation of formatting


I'm out of the office for 2 days - so i'm afraid I cannot help until
Saturday. However, this code is excel vba and should be clear enough to get
you going.
Open excel, go to the development environment (ALT+F11), add a module
(Insert/Module) then paste the code:
change the SQL statement and the name of the MS Access database
appropriately

Sub LoadDataFromAccess()
Dim MyFile As String
Dim con As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim SQL As String
Dim i As Long

MyFile = "Risk.mdb"
SQL = "SELECT * FROM BondTable"

con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & MyFile

rst.Open SQL, con, adOpenStatic

Cells.Clear

For i = 0 To rst.Fields.Count - 1
Cells(1, i + 1).Value = rst.Fields(i).Name
Next

Range("A2").CopyFromRecordset rst

rst.Close
con.Close

Set rst = Nothing
Set con = Nothing

End Sub



"Imran Ghani" wrote in message
...
Hi Patrick Molloy
Thanks for your reply. Kindly do guide me about the whole process,
mentioned
by you, as I, being a novice, am certainly not much capable to handle the
job
independently. I'd much appreciate your helping hand.
Regards,
Imran.

"Patrick Molloy" wrote:

ah. from your question I thought Excel was driving the import, but in
fact
MS Access is doing this..so AFAIK you can't format this way, you'd have
to
write more VBA in Access to open the spreadsheet then format it. I don't
think Access gives you much control.
What would be "better" is to instantiate excel, load the table from the
query and then you'd have more control over the excel range.
Do you know how to do this?


"Imran Ghani" wrote in message
...
Hi Patrick Molloy

I am exporting my data with a query as:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
"qryinvrgstr",
"d:\invoice register.xls", True

Its working fine and exporting the data ok, but I'd like also to get
totals
in the end of the data and also to format my whole data with lines all
around. I'd much appreciate your guidance.

Regards,
Imran.

"Patrick Molloy" wrote:

both can be done quite easily...but we'd need to see the code that
loads
the
sheet with the MS Access data to get a handle on the method used in
order
to
give you an appropriate response.

for example you may have
Range("A1").CopyFromrecordset rst
or various other methods of loading the data to the sheet.



"Imran Ghani" wrote in message
...
Hi! I want to format my excel data that's been imported from MS
Access,
such
that, ther's a box around all the data cells, also please help me,
about
how
to have my aggregate fields at the end of the data. Can this be
achieved
using MS Excel 2007, automation using macros, or VBA. I'd much
appreciate
your guiding remarks. Thanks in advance.
Regards,
Imran.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automation Ole Excel conditional formatting with PowerBuilder 9 fhhl Excel Programming 0 February 18th 09 01:28 PM
Automation Q Rick Excel Programming 0 August 30th 07 08:02 PM
Supressing the ctrl-c and other keys during word automation in automation apondu Excel Programming 0 July 19th 07 10:10 PM
Repetitive Spreadsheet Formatting Automation excel addict Excel Programming 2 January 4th 06 06:33 AM
Automation Chris Excel Programming 1 March 8th 05 06:45 PM


All times are GMT +1. The time now is 03:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"