Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't have any programming experience, but I was wondering if ther
was a way to make a button in Excel that you could click and have i open a file and copy the file into your already open worksheet. At first I thought it may be as simple as creating a macro, but now don't think so. What I would like the button to do is: 1. Open a box that asks you to select the file you want to open. 2. Open the file (a .txt file) and select Delimited with Tabs an Spaces as delimiters. 3. Copy the contents of the file an place them into the worksheet yo already have open. I would love it if the only user intervention was selecting the prope file to open, and the program did the rest. Is this that difficult to accomplish? I guess I will go read up o programming in Excel -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry about the multiple threads, my internet has been acting wierd
-- Message posted from http://www.ExcelForum.com |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you're using xl2k or higher, try recording a macro when you do:
Data|Import external data (may be a different name in different versions). If you're using xl97 (or higher even), you could use something like: Option Explicit Sub testme() Dim myFileName As Variant Dim DestCell As Range myFileName = Application.GetOpenFilename("Text files, *.txt") If myFileName = False Then Exit Sub 'user hit cancel End If With ActiveSheet Set DestCell = .Cells(.Rows.Count, "A").End(xlUp).Offset(1, 0) End With Workbooks.OpenText Filename:=myFileName, _ Origin:=437, StartRow:=1, DataType:=xlDelimited, _ TextQualifier:=xlDoubleQuote, _ ConsecutiveDelimiter:=True, Tab:=True, Semicolon:=False, Comma:=False, _ Space:=True ActiveSheet.UsedRange.Copy _ Destination:=DestCell ActiveSheet.Parent.Close savechanges:=False End Sub "kolbydayne <" wrote: I don't have any programming experience, but I was wondering if there was a way to make a button in Excel that you could click and have it open a file and copy the file into your already open worksheet. At first I thought it may be as simple as creating a macro, but now I don't think so. What I would like the button to do is: 1. Open a box that asks you to select the file you want to open. 2. Open the file (a .txt file) and select Delimited with Tabs and Spaces as delimiters. 3. Copy the contents of the file an place them into the worksheet you already have open. I would love it if the only user intervention was selecting the proper file to open, and the program did the rest. Is this that difficult to accomplish? I guess I will go read up on programming in Excel! --- Message posted from http://www.ExcelForum.com/ -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
need macro from button to open selectable file | Excel Worksheet Functions | |||
how to get a button added to a speardsheet to open another file? | Excel Discussion (Misc queries) | |||
Favourites button - File Open dialog box | Excel Discussion (Misc queries) | |||
Create button to open a file | Excel Programming | |||
VBA - on a button event, open another closed file, post changes, close file | Excel Programming |