Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I Import a spreed sheet
OK what i have is for spread sheets they are all named with a number_1 .
There are always4 files for each number. When each file imports I Need 1 to be called sheet 2 2 to be 3 3 to be 4 and 4 to be 5. Sheet 1 is my template. Here is the code im using to import one at a time. Sub Import_AA_Tabs() Dim CurWks As Worksheet Dim myWkbk As Workbook Dim myFileName As Variant Dim rng5 As Range Dim rng6 As Range Dim rng7 As Range Dim rng8 As Range Dim rng9 As Range Dim rng As Range Dim LastRow As Long Sheets.Add ' add a blank sheet Set CurWks = ActiveSheet 'or whatever you want it to be 'code to get the name and open the .csv file myFileName = Application.GetOpenFilename(filefilter:="xls Files, *.Xls", _ Title:="Pick a File") If myFileName = False Then MsgBox "Ok, try later" 'user hit cancel Exit Sub End If Workbooks.Open FileName:=myFileName '....rest of recorded code here! Set myWkbk = ActiveWorkbook myWkbk.Worksheets(1).UsedRange.Copy _ Destination:=CurWks.Range("a1") '(Paste into A1 of the original sheet????) 'close the .csv file without making changes myWkbk.Close savechanges:=False End Sub -- Message posted via http://www.officekb.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
print borders on spreed sheet | Excel Worksheet Functions | |||
import spreed sheet into word | Excel Discussion (Misc queries) | |||
Formating Excel Spreed Sheet | Excel Discussion (Misc queries) | |||
Auto fill the next row in spreed sheet | Excel Programming | |||
How would I add an extra column in a spreed sheet | Excel Worksheet Functions |