Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open Specific File
Hi All
I have been tinkering with this for a while and am hoping someone ma be able to help. I have created a userform that will enter three pcs of information o to a Spreadsheet, into Cells A1 to A3. Name - Month - Group. ( Al three are obviously variables, depending on who enters the informatio ) The spreadsheet then pools this information into cells A4 an automatically saves the file as NAME-MONTH-GROUP.xls. The problem I have is that I want the user to be able to use anothe userform to be able to retrive their file. All the files are saved i the same place, I am just not quite sure of the code to retrieve them Thanks for any hel -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open Specific File
Why not use the same form with a button to save and another button t
open You would then only need to use the workbook open command once the use has entered the relavant info into the text boxes Try Sub fffff() Dim sFile As String sFile$ = Range("a4").Value If sFile = "" Then Exit Sub End If If Dir(sFile) = "" Then MsgBox "File Not Found" ' or use sFile$ = Application.GetOpenFilename("Excel Files (*.*),*.xls") If sFile = False Then Exit Sub End If End If Workbooks.Open FileName:=sFile End Su -- Message posted from http://www.ExcelForum.com |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open Specific File
Hi Mudraker
Sorry I think I am having a Monday moment. What you have makes sense but I am struggling to incororate it into what I have already. This is the code I have been using to save the filr. Thanks David Private Sub CmndOK_click() Workbooks.OpenText FileName:="U:\scorecard.xls", Origin:=xlWindows ActiveWorkbook.Sheets("SCORECARD").Activate Range("B1").Select ActiveCell.Value = txtname.Value ActiveCell.Offset(1, 0) = Cmbgroup.Value ActiveCell.Offset(2, 0) = cmbmonth.Value ActiveCell.Offset(3, 0) = Txtstart.Value Range("F1").Select ActiveWorkbook.SaveAs FileName:=Range("F1").Value & ".xls" Unload Me End Su -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
can excel automaticaly open file from specific folder | Excel Discussion (Misc queries) | |||
Is there a way to open an excel file to a specific worksheet? | Excel Discussion (Misc queries) | |||
Open file to specific tab | Excel Discussion (Misc queries) | |||
Macro to open specific File | Excel Discussion (Misc queries) | |||
From HTML open a specific worksheet within a excel file | Excel Programming |