you can do it with a looping macro that evaluates each cell in a column until it reaches a break point.
but the rub is tayloring it to your specific needs.
this one works in our office to dump data up into a mktg system.
Dim detailLine As String
r = 1 'row designated for reading data
c = 1 'col designated for reading data
Do Until ThisWorkbook.Sheets("Upload").Cells(r + 1, c + 6) = ""
CSV = ThisWorkbook.Sheets("Upload").Cells(r + 1, c + 6)
Sheets("Upload").Select
detailLine = Range("G2")
'detailLine = "line of data as csv text"
import.ImportDetail ((detailLine))
If Flag = "" Then
Rows(r + 1).Select
Selection.Delete Shift:=xlUp
Else
r = r + 1
End If
'Loop 'until we run out of data
Loop
import.ImportEnd
Set import = Nothing
End Sub
|