Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
can excel automaticaly open file from specific folder sand Excel Discussion (Misc queries) 1 July 7th 07 03:56 PM
Is there a way to open an excel file to a specific worksheet? Nicholas Excel Discussion (Misc queries) 1 December 5th 06 10:29 PM
Open file to specific tab [email protected] Excel Discussion (Misc queries) 5 June 16th 06 03:55 AM
Macro to open specific File tamato43 Excel Discussion (Misc queries) 4 May 18th 05 09:42 PM
From HTML open a specific worksheet within a excel file esoller Excel Programming 2 May 18th 04 09:41 PM


All times are GMT +1. The time now is 12:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"