View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ryguy7272 ryguy7272 is offline
external usenet poster
 
Posts: 2,836
Default Not a programmer...am I in over my head??

Maybe you should look at this:
http://www.rondebruin.nl/copy4.htm

Replace the red code block with your code; replace it with what you
(specifically) want to do.

Just so you know, this is a batch processing macro. The program takes a set
of data files as input, process the data, and produces a set of output data
files.

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Christina" wrote:

Hi Jim,

I recorded this maco this morning for exactly what I want to...like I said
to Bob...just get it to increment my company names by one, right?!?! HA! I
have no idea! While I started with the file "Christina helped me do this" I
can actually start with any of the "summary" files open after I create them,
right? Whatever...like I said, I just don't know what to do next. Thanks
for any help!! Here's the code:

Sub FindAndReplace()
'
' FindAndReplace Macro
'

'
ChDir "C:\Documents and Settings\cmg4\Desktop\Copy of CMHTemplate"
Workbooks.Open Filename:= _
"C:\Documents and Settings\cmg4\Desktop\Copy of
CMHTemplate\p2_wealth_act_pred_table_P2.xls"
Workbooks.Open Filename:= _
"C:\Documents and Settings\cmg4\Desktop\Copy of
CMHTemplate\p2_comp_act_pred_table_P2.xls"
Workbooks.Open Filename:= _
"C:\Documents and Settings\cmg4\Desktop\Copy of
CMHTemplate\p2_mix_act_pred_table_P2.xls"
Workbooks.Open Filename:= _
"C:\Documents and Settings\cmg4\Desktop\Copy of
CMHTemplate\p2_other_factors_act_pred_table_P2.xls "
Workbooks.Open Filename:= _
"C:\Documents and Settings\cmg4\Desktop\Copy of
CMHTemplate\p2_pay_perf_act_pred_table_P2.xls"
Workbooks.Open Filename:= _
"C:\Documents and Settings\cmg4\Desktop\Copy of
CMHTemplate\p2_relative_pay_table_P2.xls"
Windows("christina_helped_me_do_this.xlsx").Activa te
Cells.Replace What:="p1", Replacement:="p2", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False, SearchFormat:=False,
ReplaceFormat:=False
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\cmg4\Desktop\Copy of
CMHTemplate\P2_Summary.xls", _
FileFormat:=xlExcel8, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub


"Jim Thomlinson" wrote:

Yes that is very possible. In fact it is not too bad to do at all if done one
step at a time. What you need to do is to record a macro doing it on one file
and then post that code with a descripion of exactly what you are doing...
--
HTH...

Jim Thomlinson


"Christina" wrote:

I just need someone to tell me if I'm crazy to even think about trying to
figure this out or if I should just try to get a "real" programmer to do it.
Here's the problem:

5 workbooks for 1 company (call the company P1).
300 companies (P1-P300, 1500 files total).
Files are consistantly named P1_this_data, P1_that_data then P2_this_data,
P2_that_data(output from STATA in xls or cvs format).
Created a "template" where data for P1 is pulled in.
Need to pull in data into the same template from P2, then P3, etc.
Right now I know I can open the "template", open the next company's files,
do a search and replace (P1 with P2, etc.) and then save as.
For this many files...that's a lot of manual work, no?
Would like to automate:
Opening the next set of files, doing the search and replace doing the save
as and renaming.
Sorry to be so ignorant...is this even possilbe?

Thanks for any help.