#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Macro Help

Hi,

I need to find an excel macro that will traverse through a directory
and it's sub folders looking for workbooks (any .xls files) and
copying the first sheet named "qryExportReporting" contents starting
with column A:2 through E:2 and capturing as many rows that have text
then pasting that data into a different workbook
("AggregateTrainingData.xls") sheet called "Master" that has the same
formatting. I am a complete novice at excel and so far I've found
macros that do part of what I want but I can't get them to work
together to accomplish the whole task.


Any help is greatly appreciated!


Kelly

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Macro Help

This is as far as I got:

Sub GetTheData()
Dim Master As Worksheet


And it's only importing from the first two workbooks in the directory
the first time I run it. The second time I run it it imports the 1st
workbook only. Weird. Any help is greatly appreciated.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Macro Help

This is as far as I got:

Sub GetTheData()
Dim Master As Worksheet
Set Master = ActiveSheet
MsgBox "You need to select the folder, then click cancel."
Application.GetOpenFilename
On Error Resume Next
With Application.FileSearch
..NewSearch
..LookIn = CurDir
..FileType = msoFileTypeExcelWorkbooks
..Execute
For i = 1 To .FoundFiles.Count
Workbooks.Open .FoundFiles(i), False, True
Err.Clear
Sheets(1).Activate
If Err.Number < 0 Then
ActiveWorkbook.Close False
GoTo NextWB
End If
i = Master.UsedRange.Rows.Count
ActiveSheet.UsedRange.Copy
Master.Cells(i + 1, 1).PasteSpecial
Application.CutCopyMode = False
ActiveWorkbook.Close False
NextWB:
Next
End With
End Sub

....And it's only importing from the first two workbooks in the
directory the first time I run it. The second time I run it it imports
the 1st workbook only. Weird. Any help is greatly appreciated. I'm
clearly in over my head! :-)


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Macro Help

Thank you very much!

Kelly
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
AutoRun Macro with a delay to give user the choice to cancel the macro wanderlust Excel Programming 2 September 28th 07 04:09 PM
Macro not showing in Tools/Macro/Macros yet show up when I goto VBA editor [email protected] Excel Programming 2 March 30th 07 07:48 PM
how to count/sum by function/macro to get the number of record to do copy/paste in macro tango Excel Programming 1 October 15th 04 01:16 PM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


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