Thread: VBA Question
View Single Post
  #28   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben[_2_] Gord Dibben[_2_] is offline
external usenet poster
 
Posts: 621
Default VBA Question

Carl

You're missing a post or not reading the ones being sent.

I posted this yesterday.....................




Gord

On Tue, 28 Jun 2011 05:37:50 -0700 (PDT), carl wrote:

On Jun 24, 12:19*am, isabelle wrote:
i Gord,

you understand [g] right Gord, it's with pleasure ;-)
i just remember that this can be done much more simply with old tools "Excel4"
to read a single row is more than enough
i know it's ok on XL2002 to 2007 but i do not know for xl2010

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

--
isabelle


I tried using this one:

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


But was prompted with an explorer type window named "MyFile" - not
sure what to do at this point.

I am running excel 2003.