Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Public string showing empty
Hello there,
I set this "myfilename" string to store the name of the file (input box) and then re-name the sheets. Everything works fine, all functions work great until I close the file. When I re-open "myfilename" is empty, although I tried to store it in Cell "H3" What can I do different to keep the value public and permanent once the name of the file is entered? Any kind of help apprecieated, Gaba Public myfilename As String Function getmyfilename() myfilename = InputBox("Please Enter Dataset File:") Range("H3").Value = myfilename End Function -- gaba :) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Public string showing empty
You need to retrieve it when you open the workbook
Private Sub Workbook_Open() myFilename = Worksheets("Sheet1").Range("H3").Value End Sub and put it in the ThisWorkbook code module -- HTH RP "gaba" wrote in message ... Hello there, I set this "myfilename" string to store the name of the file (input box) and then re-name the sheets. Everything works fine, all functions work great until I close the file. When I re-open "myfilename" is empty, although I tried to store it in Cell "H3" What can I do different to keep the value public and permanent once the name of the file is entered? Any kind of help apprecieated, Gaba Public myfilename As String Function getmyfilename() myfilename = InputBox("Please Enter Dataset File:") Range("H3").Value = myfilename End Function -- gaba :) |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Public string showing empty
Hi
of course. You have to read it again. maybe something like the following in your workbook_open event of this file option explicit Public myfilename As String sub workbook_open() with me.worksheets("sheet1").range("H3") if .value<"" then myfilename = .value else myfilename = InputBox("Please Enter Dataset File:") .value=myfilename end if end with end sub -- Regards Frank Kabel Frankfurt, Germany "gaba" schrieb im Newsbeitrag ... Hello there, I set this "myfilename" string to store the name of the file (input box) and then re-name the sheets. Everything works fine, all functions work great until I close the file. When I re-open "myfilename" is empty, although I tried to store it in Cell "H3" What can I do different to keep the value public and permanent once the name of the file is entered? Any kind of help apprecieated, Gaba Public myfilename As String Function getmyfilename() myfilename = InputBox("Please Enter Dataset File:") Range("H3").Value = myfilename End Function -- gaba :) |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Public string showing empty
Thanks Bob and Frank... it's a learning process...
"Frank Kabel" wrote: Hi of course. You have to read it again. maybe something like the following in your workbook_open event of this file option explicit Public myfilename As String sub workbook_open() with me.worksheets("sheet1").range("H3") if .value<"" then myfilename = .value else myfilename = InputBox("Please Enter Dataset File:") .value=myfilename end if end with end sub -- Regards Frank Kabel Frankfurt, Germany "gaba" schrieb im Newsbeitrag ... Hello there, I set this "myfilename" string to store the name of the file (input box) and then re-name the sheets. Everything works fine, all functions work great until I close the file. When I re-open "myfilename" is empty, although I tried to store it in Cell "H3" What can I do different to keep the value public and permanent once the name of the file is entered? Any kind of help apprecieated, Gaba Public myfilename As String Function getmyfilename() myfilename = InputBox("Please Enter Dataset File:") Range("H3").Value = myfilename End Function -- gaba :) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 showing empty rows at bottom | Excel Discussion (Misc queries) | |||
Either showing : empty or blank | Excel Discussion (Misc queries) | |||
formulas showing up in an empty cell by themselves | Excel Discussion (Misc queries) | |||
How can I chart a data series without showing empty cells? | Charts and Charting in Excel | |||
Empty cell and a the empty String | Excel Programming |