Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Run Macro from different files

Hi,

I have created few macros to prepare Pivot Table through Record Macro
function.

I want that these macros I should able to run every month in different
files. Name of the files will be different.

What can I do to make these macros perform every month for different files.

Cheers,
Mandeep
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default Run Macro from different files

Hi ManDeep

Save your routines in a personnal macros workbook (PERSONNAL.XLS) and place
this workbook in the xlStart folder on your computer.
Or: just start recording a new dummy macro and from the record dialog box
select to record it into a personnal macros workbook, validate and then stop
recording.
You will then be able to copy your macros from the original workbook into
the newly created workbook which will only be visible from the VB Editor.

HTH
Cordially
Pascal


"Mandeep Dhami" a écrit dans le
message de news: ...
Hi,

I have created few macros to prepare Pivot Table through Record Macro
function.

I want that these macros I should able to run every month in different
files. Name of the files will be different.

What can I do to make these macros perform every month for different
files.

Cheers,
Mandeep



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Run Macro from different files

Hi Papou,

Thanks for your reply. Sorry to say but I am not able to get your solution.

Following is the script of my recorded macro would be able to make necessary
amendment in the script so that this macro can be used to get pivot table
from other files as well:

Sub Pivot_Table_1()
'
' Pivot_Table_1 Macro
' Macro recorded 1/9/2008 by Mandeep
'
' Keyboard Shortcut: Ctrl+q
'
Range("A3").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _
"'Register'!R3C1:R65536C52").CreatePivotTable _
TableDestination:="", TableName:="PivotTable1", DefaultVersion:= _
xlPivotTableVersion10
ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1)
ActiveSheet.Cells(3, 1).Select
ActiveSheet.PivotTables("PivotTable1").AddFields RowFields:="Dist Line
Type" _
, ColumnFields:="Invoice Source"
ActiveSheet.PivotTables("PivotTable1").PivotFields ("Dist Line Type"). _
Orientation = xlDataField
ActiveWorkbook.ShowPivotTableFieldList = True
ActiveWorkbook.ShowPivotTableFieldList = False
Application.CommandBars("PivotTable").Visible = False
With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Dist Line Type")
.PivotItems("(blank)").Visible = False
End With
End Sub

"papou" wrote:

Hi ManDeep

Save your routines in a personnal macros workbook (PERSONNAL.XLS) and place
this workbook in the xlStart folder on your computer.
Or: just start recording a new dummy macro and from the record dialog box
select to record it into a personnal macros workbook, validate and then stop
recording.
You will then be able to copy your macros from the original workbook into
the newly created workbook which will only be visible from the VB Editor.

HTH
Cordially
Pascal


"Mandeep Dhami" a écrit dans le
message de news: ...
Hi,

I have created few macros to prepare Pivot Table through Record Macro
function.

I want that these macros I should able to run every month in different
files. Name of the files will be different.

What can I do to make these macros perform every month for different
files.

Cheers,
Mandeep




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
macro to hyperlink individual files in multiple files GBrown Excel Programming 1 March 28th 07 02:43 AM
macro to hyperlink individual files in multiple files Gary''s Student Excel Programming 0 March 28th 07 12:17 AM
Macro to open *.dat files and save as .txt (comma delimited text files) [email protected] Excel Programming 2 November 30th 05 05:50 AM
Same macro in two files David Miller Excel Programming 2 January 5th 04 08:01 AM
Import multiple files macro can't find files Steven Rosenberg Excel Programming 1 August 7th 03 01:47 AM


All times are GMT +1. The time now is 06:11 PM.

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"