Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default If Statement to place .xls within .xls


Can someone help me with the IF statement to place .xls within a .xls.
have created a Monarch Macro that captures all the data for the day an
saved it as Day1.xls, now I need to place all the DayX.xls files into
Month.xls. Please help. Thanks in advance

--
bawaho
-----------------------------------------------------------------------
bawahoo's Profile: http://www.excelforum.com/member.php...fo&userid=1510
View this thread: http://www.excelforum.com/showthread.php?threadid=27285

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default If Statement to place .xls within .xls

Dim spath as String, sStr as String
Dim i as long
Dim bk as Workbook, bk1 as Workbook
spath = "C:\myfolder\myfiles\"
set bk = workbooks.Add
for i = 1 to 31
sStr = dir(spath & "day" & i & ".xls")
if sStr < "" then
set bk1 = workbooks.open(sPath & sStr)
bk1.worksheets(1).copy After:=bk.Worksheets(1)
bk1.Close Savechanges:=False
end if
Next
Bk.SaveAs "C:\Myfolder\MyMonths\month.xls"

--
Regards,
Tom Ogilvy


"bawahoo" wrote in message
...

Can someone help me with the IF statement to place .xls within a .xls. I
have created a Monarch Macro that captures all the data for the day and
saved it as Day1.xls, now I need to place all the DayX.xls files into a
Month.xls. Please help. Thanks in advance.


--
bawahoo
------------------------------------------------------------------------
bawahoo's Profile:

http://www.excelforum.com/member.php...o&userid=15102
View this thread: http://www.excelforum.com/showthread...hreadid=272851



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
IF statement inside a SUMIF statement.... or alternative method Sungibungi Excel Worksheet Functions 3 December 4th 09 06:22 PM
Reconcile Bank statement & Credit card statement & accounting data Bklynhyc Excel Worksheet Functions 0 October 7th 09 09:07 PM
Fun Place Bob Myers Excel Worksheet Functions 1 January 16th 08 12:14 AM
Place an IF Statement into a Macro 2007 and 2003 Lisa Excel Discussion (Misc queries) 5 January 4th 08 05:30 PM
Using "double equal signs" in place of an IF statement Scott P Excel Worksheet Functions 2 June 21st 06 04:13 AM


All times are GMT +1. The time now is 12:22 AM.

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"