yorkshirelad
Board Regular
- Joined
- Aug 18, 2003
- Messages
- 100
I have a macro that imports a csv file into an existing worksheet.
It work fine but instead of the destination cell being fixed as now to A2, I need the destination cell to be the first blank cell in column A.
This means if I already have fifteen rows of data the new imported data will start at A16, if I have 20 rows of data the new imported data will start at A21
This is the working macro - any help would be really appreciated.
Sub importing_csv_cliente()
Dim file As String
Dim src As Worksheet
Dim dst As Worksheet
Application.ScreenUpdating = False
'-- determine destination range
Set dst = ActiveSheet
'-- determine source csv file
file = "cliente.csv"
'-- determine data source range
Set src = Workbooks.Open(file).Worksheets(1)
'-- copy the data
src.Range("A1:l5").Copy dst.Range("A2")
'-- close csv file
src.Parent.Close False
End Sub
Many thanks
It work fine but instead of the destination cell being fixed as now to A2, I need the destination cell to be the first blank cell in column A.
This means if I already have fifteen rows of data the new imported data will start at A16, if I have 20 rows of data the new imported data will start at A21
This is the working macro - any help would be really appreciated.
Sub importing_csv_cliente()
Dim file As String
Dim src As Worksheet
Dim dst As Worksheet
Application.ScreenUpdating = False
'-- determine destination range
Set dst = ActiveSheet
'-- determine source csv file
file = "cliente.csv"
'-- determine data source range
Set src = Workbooks.Open(file).Worksheets(1)
'-- copy the data
src.Range("A1:l5").Copy dst.Range("A2")
'-- close csv file
src.Parent.Close False
End Sub
Many thanks