G
Guest
hi how can i modify this code so that the data is entered in the next empty
cell in
column a
Sub ImportDataFile()
Dim myFName As Variant
Dim myWkSht As Worksheet
Set myWkSht = ActiveSheet
ChDir "C:\mydata"
myFName = Application.GetOpenFilename(, , "Select the Data File")
If myFName = False Then
MsgBox "You pressed Cancel"
Exit Sub
Else
Workbooks.OpenText Filename:=myFName, _
StartRow:=1, DataType:=xlDelimited, Comma:=True
End If
Range("A
").Copy _
myWkSht.Range("A
")
ActiveWorkbook.Close False
'
End Sub
thanks for the help guys
cell in
column a
Sub ImportDataFile()
Dim myFName As Variant
Dim myWkSht As Worksheet
Set myWkSht = ActiveSheet
ChDir "C:\mydata"
myFName = Application.GetOpenFilename(, , "Select the Data File")
If myFName = False Then
MsgBox "You pressed Cancel"
Exit Sub
Else
Workbooks.OpenText Filename:=myFName, _
StartRow:=1, DataType:=xlDelimited, Comma:=True
End If
Range("A
").Copy _myWkSht.Range("A
")ActiveWorkbook.Close False
'
End Sub
thanks for the help guys