LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 42
Default VBA Question (Again)

I was having trouble adding to my previous post so trying to start a
"new" one. The previous post is titled "VBA Question".

I am running Excel 2003.

My task is to extract the 5th row of data from a list of workbooks. I
have the list of workbooks in A1:A223. It looks like this:

J:\Projects\ORF\Meeds\xlsx\001\ORF.xlsx
J:\Projects\ORF\Meeds\xlsx\002\ORF.xlsx
J:\Projects\ORF\Meeds\xlsx\003\ORF.xlsx
J:\Projects\ORF\Meeds\xlsx\004\ORF.xlsx
J:\Projects\ORF\Meeds\xlsx\005\ORF.xlsx

Note these are xlsx files - if that matters. Also note that it is
possible for one of these files to not exist.

I am looking for a way to extract the 5th row of data (A5:H5) from
these files.

In the previous post, a recomendation was to try this:

Sub test2()
Dim nRow As Integer, nColumn As Integer, n As Integer
Dim sDir As String
nRow = 5
For i = 1 To 1
sDir = Range("A" & i) 'Range("A1:Ax") contains values like "c:\temp
\"
n = n + 1
For nColumn = 1 To 256
Sheets(2).Cells(n, nColumn) = ExecuteExcel4Macro _
("'" & sDir & "[MyFile.xls]ORF_Charge'!R" & nRow & "C" & nColumn
& "")
Next
Next
End Sub

When I run this, I get prompted by an "explorer" type window named
"MyFile" that looks like it needs me to select a file. I am not sure
what to do at that point.

Thank you in advance.

Regards.



 
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
Excel 2007 Macro/VB Question DDE Question MadDog22 Excel Worksheet Functions 1 March 10th 10 01:47 AM
#DIV/0! Question TKM Excel Worksheet Functions 6 October 19th 08 01:20 AM
where can I see my question and answer? Yesterday I ask a question IP Excel Discussion (Misc queries) 2 May 10th 08 04:08 PM
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM
The question is an excel question that I need to figure out howto do in excel. Terry Excel Worksheet Functions 3 January 23rd 06 06:22 PM


All times are GMT +1. The time now is 11:18 AM.

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"