LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default Reference to Multiple Opened Workbooks

I have a folder with a varying number of workbooks that I need to
reference and retrieve data out. While I can get it to find all the
workbooks I can't get it to reference certain columns in those
workbooks. Then find the next available "open" column in the summary
workbook and place the data in it...

Any daylight to how I need to do this is appreciated. There have been a
few of you that has helped immensely and that is how I am learning
VB/VBA. Kudo's to you!

Here is the opening code:

Sub getdata()
Dim SpecialProjectLite As Workbook
With Application.FileSearch
.NewSearch
.LookIn = ThisWorkbook.Path
.SearchSubFolders = False
.Filename = "m*.htm"
.MatchTextExactly = True
.FileType = msoFileTypeExcelWorkbooks
If .Execute() 0 Then
For i = 1 To .FoundFiles.Count
Workbooks.Open Filename:=.FoundFiles(i)
Set wkbk = ActiveWorkbook

Dim cell As Range, rng As Range
Set rng = Range(Cells(1, "D"), Cells(Rows.Count, "D").End(xlUp))
For Each cell In rng
If cell = "Would you like to add any comments?" Then
cell.Offset(0, -3).ClearContents
End If
Next

Next i
Else
MsgBox "No MAP Files Found; did you save in correct folder?"
End If
End With

The second major portion of code is this and this is where I kind of
understand, but can't quite get it:
My 1st column in the "Summary" is D and I want to place data from
"M1.htm" into that column. Then find the next "m*.htm" workbook and
place that data into the next available column, E. I have tried placing
this code directly after the next and before the next i. Then change
the 'm1.htm to 'm*.htm, but I cannot get it to work properly


Windows("MAP Report Lite").Activate
Dim LastRow As Long
With Worksheets("Summary")
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
With .Range("D34:D" & LastRow)
.Formula =
"=IF(ISERROR(INDEX('m1.htm'!$E:$E,MATCH(C34,'m1.ht m'!$A:$A,0))),"""",INDEX('m1.htm'!$E:$E,MATCH(C34, 'm1.htm'!$A:$A,0)))"
.Value = .Value
End With

End With

Thanks,

Hans

 
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
History of Workbooks opened derek Excel Worksheet Functions 1 May 20th 09 05:55 PM
Can I create a 3-D reference from multiple workbooks Jennifer Excel Worksheet Functions 2 January 8th 09 08:27 PM
cell reference for multiple workbooks Libby Excel Discussion (Misc queries) 1 July 17th 07 05:08 PM
always prompted to save opened workbooks kjbrr Excel Discussion (Misc queries) 2 July 31st 06 08:10 PM
multiple workbooks reference Mitch Excel Programming 1 June 13th 05 08:45 PM


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