Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Souny
This worked for me. Just change the path to suit. Adds the data from the userfile.xls to the bottom of the used range in the trackfile.xls. Take care Marcus Option Explicit Option Compare Text Sub Open_Import1() Dim oWbk As Workbook Dim sFil As String Dim sPath As String Dim twbk As Workbook Dim lr As Integer Dim strFullName As String Set twbk = ActiveWorkbook Application.DisplayAlerts = False Application.ScreenUpdating = False twbk.Sheets("Sheet1").Range("A1:B1").Copy sPath = "R:\" 'Cell B2 of Cal sheet, location of files ChDir sPath sFil = Dir("trackfile.xls") 'change or add formats strFullName = sPath & sFil Set oWbk = Workbooks.Open(strFullName) lr = oWbk.Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row + 1 oWbk.Sheets("Sheet1").Range("A" & lr).PasteSpecial xlPasteValues oWbk.Close True 'close the workbook, saving changes sFil = Dir End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Writing a macro in Excel that Refreshes External Imported Text File | Excel Programming | |||
Open external data (varying file names) and closing file once data is retrieved | Excel Programming | |||
Writing streaming data to txt file | Excel Programming | |||
writing data to a tab delimited text file? | Excel Programming | |||
Writing to a text file some data | Excel Programming |