MACRO --- I have:
NewFileNumber = Application.GetOpenFilename(FileFilter:="All Files
(*.*),*.*", Title:="Select a HEX file to import")
Open NewFileNumber For Input As #1
If filename is C:/temp.txt, I want to past that to a cell. I can copy
and past the content of variable 'NewFileNumber' if I knew how to copy
the content of 'NewFileNumber' . It is probaably easy to do but I just
don't know how to do it. Research is drawing a blank. TIA.
Dave Peterson - 22 Sep 2007 18:33 GMT
You can just plop that variable's contents directly into a cell:
Dim NewFileNumber as variant
NewFileNumber = Application.GetOpenFilename(FileFilter:="All Files (*.*),*.*", _
Title:="Select a HEX file to import")
if newfilenumber = false then
'user hit cancel
exit sub '???
end if
worksheets("sheet1").range("A1").value = newfilenumber
'rest of your code
Open NewFileNumber For Input As #1
> MACRO --- I have:
> NewFileNumber = Application.GetOpenFilename(FileFilter:="All Files
[quoted text clipped - 5 lines]
> the content of 'NewFileNumber' . It is probaably easy to do but I just
> don't know how to do it. Research is drawing a blank. TIA.

Signature
Dave Peterson
a924fan@yahoo.com - 22 Sep 2007 22:57 GMT
Thanks a million Dave, worked great!