Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Combining Macro Files

Hi all,

I have just finished creating 3 macros for one team in my company i.e
.xls files. For me to run these macros i have to firstly open 3 ra
data files (backlog, closed and opened cases). Then i have to open th
three macro files (Team1BacklogMacro, Team1ClosedMacro an
Team1OpenMacro). Then i have to go to each raw data file , run th
correct Macro, then save it under Team1BacklogCases, Team1....etc. As
will have to do this process with 4 teams, i would like to know i
there is a way of making this automatic, i.e. have a master macro tha
will ask for the file location of the raw data and the macro files
then run them all and then prompt for what each file will be saved as


Is there any one out there that could please help?
Any ideas on this would be great.

Thanks in advance,
Catha

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Combining Macro Files

This sounds like you want to "Get External Data" from a database file and
then manipulate that data with macros. I have done this from 1 workbook.
Each data file will be on a different sheet in the workbook. From there the
data can be filtered by Team1, Team2, etc as needed. Then run your macros on
the appropriate sheets that are filtered by team and save as Team whatever.
That way there would be 1 workbook for each team saved with all 3 sheets
included (backlog, closed, & open).

email me from your work or home and I can get you started with some example
code or workbook. I will need some particulars on what you are doing.
Mike F
"CPower " wrote in message
...
Hi all,

I have just finished creating 3 macros for one team in my company i.e 3
xls files. For me to run these macros i have to firstly open 3 raw
data files (backlog, closed and opened cases). Then i have to open the
three macro files (Team1BacklogMacro, Team1ClosedMacro and
Team1OpenMacro). Then i have to go to each raw data file , run the
correct Macro, then save it under Team1BacklogCases, Team1....etc. As i
will have to do this process with 4 teams, i would like to know if
there is a way of making this automatic, i.e. have a master macro that
will ask for the file location of the raw data and the macro files,
then run them all and then prompt for what each file will be saved as.


Is there any one out there that could please help?
Any ideas on this would be great.

Thanks in advance,
Cathal


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Combining Macro Files

I think I'd combine my 3 macros into one workbook and add a little more to get
the names of the files to open.

Then have the user open my giant combined macro workbook.

The little extra could look something like:

Option Explicit
Sub testme()

Dim wkbkNames(1 To 3) As String
Dim wkbks(1 To 3) As Workbook
Dim iCtr As Long
Dim myTitles(1 To 3) As String
Dim myFileName As Variant

myTitles(1) = "backlog"
myTitles(2) = "closed"
myTitles(3) = "open"

For iCtr = LBound(wkbks) To UBound(wkbks)
myFileName = Application.GetOpenFilename _
(Title:="Please select " & myTitles(iCtr) & " file")
If myFileName = False Then
Exit Sub
Else
wkbkNames(iCtr) = myFileName
End If
Next iCtr

For iCtr = LBound(wkbks) To UBound(wkbks)
'whatever you do to open them
Set wkbks(iCtr) = Workbooks.Open(wkbkNames(iCtr))
Next iCtr

End Sub

Now you have 3 files open and in variables wkbks(1), wkbks(2), and wkbks(3).

You can refer to those workbooks in your other macros.


Sub firstrealmacro(wkbk as workbook)
'do all your work
end sub

And call it like:

call firstrealmacro(wkbks(1))



"CPower <" wrote:

Hi all,

I have just finished creating 3 macros for one team in my company i.e 3
xls files. For me to run these macros i have to firstly open 3 raw
data files (backlog, closed and opened cases). Then i have to open the
three macro files (Team1BacklogMacro, Team1ClosedMacro and
Team1OpenMacro). Then i have to go to each raw data file , run the
correct Macro, then save it under Team1BacklogCases, Team1....etc. As i
will have to do this process with 4 teams, i would like to know if
there is a way of making this automatic, i.e. have a master macro that
will ask for the file location of the raw data and the macro files,
then run them all and then prompt for what each file will be saved as.

Is there any one out there that could please help?
Any ideas on this would be great.

Thanks in advance,
Cathal

---
Message posted from http://www.ExcelForum.com/


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Combining Macro Files

would you be able to give me your email address please Mike?

Thanks for this help,
Catha

--
Message posted from http://www.ExcelForum.com

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
Combining Files - Think Outside the Box [email protected] Excel Discussion (Misc queries) 1 September 20th 07 10:07 PM
Combining Two Files PaulL Excel Worksheet Functions 1 January 18th 07 09:16 PM
combining files Harlen New Users to Excel 1 February 20th 05 07:37 PM
Macro Help- combining "CS" files Judyt Excel Discussion (Misc queries) 1 February 17th 05 02:19 AM
Combining Files RJ Leburg Excel Programming 5 January 13th 04 03:49 AM


All times are GMT +1. The time now is 05:50 PM.

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

About Us

"It's about Microsoft Excel"