Thread: inputing data
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ashw1984 ashw1984 is offline
external usenet poster
 
Posts: 10
Default inputing data

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:D").Copy _
myWkSht.Range("A:D")
ActiveWorkbook.Close False
'
End Sub

thanks for the help guys