Export to Excel in Macro instead of copy to clipboard
Hi everybody
I have doubt pls clarify me
I have an table and i want export that to excel sheet when I write a macro to export that its just copying my table to clipboard and its look like this
Date
Fund
Sector
25-06-2012
Total
Zimb Fund
Comm.
Cons
Cons. Non-Cycl.
Diver
Financial
Industrial
Materials
Greater Fund
Comm.
GDF
Cons. Non-Cycl.
Diversified
Energy
Financial
Industrial
Materials
Kodun Fund
Comm.
Cons. Cycl.
Cons. Non-Cycl.
Divers
Energy
Financial
Funds
Sports
Materials
Utilities
but when i export that manually its coming like this
Date
Fund
Sector
25-06-2013
Zimb Fund
Comm.
25-06-2014
Zimb Fund
Cons
25-06-2015
Zimb Fund
Cons. Non-Cycl.
25-06-2016
Zimb Fund
Diver
25-06-2017
Zimb Fund
Financial
25-06-2018
Zimb Fund
Industrial
25-06-2019
Zimb Fund
Materials
25-06-2020
Greater Fund
Comm.
25-06-2021
Greater Fund
GDF
25-06-2022
Greater Fund
Cons. Non-Cycl.
25-06-2023
Greater Fund
Diversified
25-06-2024
Greater Fund
Energy
25-06-2025
Greater Fund
Financial
25-06-2026
Greater Fund
Industrial
25-06-2027
Greater Fund
Materials
25-06-2028
Kodun Fund
Comm.
25-06-2029
Kodun Fund
Cons. Cycl.
25-06-2030
Kodun Fund
Cons. Non-Cycl.
25-06-2031
Kodun Fund
Divers
25-06-2032
Kodun Fund
Energy
25-06-2033
Kodun Fund
Financial
25-06-2034
Kodun Fund
Funds
25-06-2035
Kodun Fund
Sports
25-06-2036
Kodun Fund
Materials
25-06-2037
Kodun Fund
Utilities
I want this type of data when I use macros.please help with this.My macro script is
Sub Performance
'Set the path where the excel will be saved
filePath = "D:\Baba\Performance.csv"
'Create the Excel spreadsheet
Set excelFile = CreateObject("Excel.Application")
excelFile.Visible = true
'Create the WorkBook
Set curWorkBook = excelFile.WorkBooks.Add
'Create the Sheet
Set curSheet = curWorkBook.WorkSheets(1)
'Get the chart we want to export
Set tableToExport = ActiveDocument.GetSheetObject("CH1893")