Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import a spreadsheet
can anyone help me with importing one spreadsheet into another. the sheet
to be imported has about 200 rows and about 10 columns. i basically want to attempt to use the GetOpenFilename method to select the file, and copy and paste the text into the active sheet. TIA. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import a spreadsheet
Hi, give this a try:
'############################################ Dim Fname$, ParentBook$ ParentBook = ActiveBook.Name MsgBox "Select file." On Error GoTo 0 FName = Application.GetOpenFilename If FName = "False" Then MsgBox "You failed to File. This will end the process.", vbOKOnly Exit Sub End If Err.Clear Range("A1:C19").Select 'Whatever range you want Selection.Copy Application.DisplayAlerts = False ActiveWorkbook.Close SaveChanges:=False Application.DisplayAlerts = True Cells(1,1).Select ActiveSheet.Paste '################################### HTH--Lonnie M. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import a spreadsheet
Hi, you may also want to take a look at the Copy Before function, it
looks something like this: Sheets("myOriginalWorksheet").Copy Befo=Workbooks("myGetOpenWorkbook").Sheets(1) Regards--Lonnie M. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import a spreadsheet
Let me make a correction to my above example, I changed my thought
process in mid stream: '############################################ Dim Fname$, ParentBook$, CildBook$ ParentBook = ActiveBook.Name MsgBox "Select file." On Error GoTo 0 FName = Application.GetOpenFilename If FName = "False" Then MsgBox "You failed to File. This will end the process.", vbOKOnly Exit Sub End If Err.Clear ChildBook = ActiveWorkbook.Name Range("A1:C19").Select 'Whatever range you want Selection.Copy Workbooks(ParentBook).Activate Cells(1,1).Select ActiveSheet.Paste Application.DisplayAlerts = False ActiveWorkbook.Close SaveChanges:=True Application.DisplayAlerts = True '################################### |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
import data from several spreadsheets into one spreadsheet | Excel Worksheet Functions | |||
Import Spreadsheet into Access | Excel Worksheet Functions | |||
How can I import our logo into a spreadsheet? | Excel Discussion (Misc queries) | |||
Import data to a spreadsheet. | Excel Discussion (Misc queries) | |||
Import of Database VB app into Excel Spreadsheet | Excel Programming |