Hi All
I need to check that a Range name exists in an XL worksheet so I can
import data into it from Access VB code.
( I have found it is easiest to do a Transferspreadsheet to a named
range called "data"
eg.
DoCmd.TransferSpreadsheet acExport, 8, "qryXLExport",
"myworksheet.xls", True, "data"
DoEvents)
On the microsoft website, and other various sites I have found a code
snippet :-
-----------------------------------------------------------
Sub Find_Names()
' Loop through all names in workbook.
For Each n In ActiveWorkbook.Names
.........
Next
MsgBox "No More Names!"
' Display message when finished.
End Sub
--------------------------------------------------------
I really need to know how to define N as an XL range in VB code
ie.
For Each N In ........
I cannot find an example of how to declare N
eg
dim n as range
dim n as xl.range
Thanks for any ideas
Ray