Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Venkataraman.P.E
 
Posts: n/a
Default How do I record a macro which should work on multiple files ?

Hi, I'am interested in creating Macros for some job tasks of mine. I went
through the Excel course of "Working with Loops" in Macros and have attained
some basic information on VBA. But since I'am not an expert in it, I want to
create Excel macros, using the Option " RECORD MACRO" in excel. My problem is
that, I want the MACRO to (a) Copy data from 2 files into a new file. (b)
Analyze this data with calculations (c) Build a graph.......basically the
summary sheet and graph in a new sheet of the new file. I want to know,
whether, can we do such a macro using "RECORD" feature? But I did try. I was
stuck when I had to open 2 different files........I want the MAcro to prompt
MssageBox as " Open the Last Month File" and.....then " Open the current
month file" and so on..............But this is somehow not possible without
VBA scripting........but I have learnt how to insert a Message Box, using
"MsgBox" command. But this box should have a space to browse and select the
files......which I'am not aware of how to do it........Can you kindly help me
out by suggesting me on the above, point by point ...of how I should be able
to do it? And also if possible suggest me the link in MS Ofice Online to a
course on Macros that will help me gain knowledge on the above ?
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Too many questions in there.

I suggest you record a macro that does the basic job, open file 1, open file
2, merge the data, graph it. Then break it down into its separate parts, and
decide which bits you want changed. If you have difficulty, post again with
a specific question, details, and code.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Venkataraman.P.E" wrote in
message ...
Hi, I'am interested in creating Macros for some job tasks of mine. I went
through the Excel course of "Working with Loops" in Macros and have

attained
some basic information on VBA. But since I'am not an expert in it, I want

to
create Excel macros, using the Option " RECORD MACRO" in excel. My problem

is
that, I want the MACRO to (a) Copy data from 2 files into a new file. (b)
Analyze this data with calculations (c) Build a graph.......basically the
summary sheet and graph in a new sheet of the new file. I want to know,
whether, can we do such a macro using "RECORD" feature? But I did try. I

was
stuck when I had to open 2 different files........I want the MAcro to

prompt
MssageBox as " Open the Last Month File" and.....then " Open the current
month file" and so on..............But this is somehow not possible

without
VBA scripting........but I have learnt how to insert a Message Box, using
"MsgBox" command. But this box should have a space to browse and select

the
files......which I'am not aware of how to do it........Can you kindly help

me
out by suggesting me on the above, point by point ...of how I should be

able
to do it? And also if possible suggest me the link in MS Ofice Online to a
course on Macros that will help me gain knowledge on the above ?



  #3   Report Post  
Norman Jones
 
Posts: n/a
Default

Hi PE,

The macro recorder is an extremely useful tool it requires additional
editing work to covert this into efficient code or code that can be reused
more widely.

I would make two suggestions:

(1) See David McRitchie's maco introduction notes at:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

Although some of the material will be familiar to you, there there are links
to tutorials and other development sorces.

(2) Now is a very appropriate time to purchase a good book. If you do a
Google groups search for "Books" you will find many suggestions. Popular
suggestions for an an intermdiate book preponderantly include those written
by John Walkenbach.

If you visit John Walkenbach's site at:

http://www.j-walk.com/ss/excel/tips/index.htm

you can use his Excel Books page. If you investigate the site you will
discover a veritable treasure trove for the aspiring Excel expert to devour.
As a starting point, investigate the Excel Books, Excel Links and the Excel
Help Resources pages,

........but I have learnt how to insert a Message Box, using
"MsgBox" command. But this box should have a space to
browse and select the files......
which I'am not aware of how to do it........


Try something like:

Sub Tester()
Dim myFileName As Variant
Dim WB As Workbook

myFileName = Application.GetOpenFilename("Excel Files, *.xls")
If myFileName = False Then
Exit Sub
End If

Set WB = Workbooks.Open(Filename:=myFileName)

End Sub

---
Regards,
Norman


"Venkataraman.P.E" wrote in
message ...
Hi, I'am interested in creating Macros for some job tasks of mine. I went
through the Excel course of "Working with Loops" in Macros and have
attained
some basic information on VBA. But since I'am not an expert in it, I want
to
create Excel macros, using the Option " RECORD MACRO" in excel. My problem
is
that, I want the MACRO to (a) Copy data from 2 files into a new file. (b)
Analyze this data with calculations (c) Build a graph.......basically the
summary sheet and graph in a new sheet of the new file. I want to know,
whether, can we do such a macro using "RECORD" feature? But I did try. I
was
stuck when I had to open 2 different files........I want the MAcro to
prompt
MssageBox as " Open the Last Month File" and.....then " Open the current
month file" and so on..............But this is somehow not possible
without
VBA scripting........but I have learnt how to insert a Message Box, using
"MsgBox" command. But this box should have a space to browse and select
the
files......which I'am not aware of how to do it........Can you kindly help
me
out by suggesting me on the above, point by point ...of how I should be
able
to do it? And also if possible suggest me the link in MS Ofice Online to a
course on Macros that will help me gain knowledge on the above ?



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
Record new macro ghosted Pat Excel Discussion (Misc queries) 1 January 7th 05 04:26 PM
multiple text files URGENT tasha Excel Discussion (Misc queries) 1 December 19th 04 05:44 PM
importing multiple text files??? tashayu Excel Discussion (Misc queries) 0 December 19th 04 02:43 PM
Record Macro Relative does not work? lbbss Excel Discussion (Misc queries) 3 December 13th 04 08:43 PM
Record Macro Relative does not work? lbbss Excel Discussion (Misc queries) 1 December 13th 04 07:55 PM


All times are GMT +1. The time now is 06:38 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"