1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
RowIndex = 2
MaxRows = 30000
NewVal1 = ""
NewVal2 = ""
NewVal3 = ""
NewVal4 = ""
For RowIndex = 2 To MaxRows
Do While Trim(Worksheets(6).Cells(RowIndex, 1)) <> ""
Application.StatusBar = "Creating File..." & Str(RowIndex)
NewVal1 = Replace(Format(Worksheets(6).Cells(RowIndex, 9), "0.000"), ",", ".")
NewVal2 = Replace(Format(Worksheets(6).Cells(RowIndex, 10), "0.000"), ",", ".")
NewVal3 = Replace(Format(Worksheets(6).Cells(RowIndex, 11), "0.000"), ",", ".")
NewVal4 = Replace(Format(Worksheets(6).Cells(RowIndex, 12), "0.000"), ",", ".")
strSql = Chr(34) & Worksheets(6).Cells(RowIndex, 1) & Chr(34) & ";" & Worksheets(6).Cells(RowIndex, 2) & ";" & Worksheets(6).Cells(RowIndex, 3) & ";" & Worksheets(6).Cells(RowIndex, 4) & ";" & Worksheets(6).Cells(RowIndex, 5) & ";" & Chr(34) & Worksheets(6).Cells(RowIndex, 6) & Chr(34) & ";" & Worksheets(6).Cells(RowIndex, 7) & ";" & Worksheets(6).Cells(RowIndex, 8) & ";" & Chr(34) & Chr(34) & ";;" & Chr(34) & Chr(34) & ";" & Chr(34) & Chr(34) & ";" & NewVal1 & ";" & NewVal2 & ";" & NewVal3 & ";" & NewVal4 & ";;;;" & Chr(34) & Chr(34) & ";;" & Chr(34) & Chr(34)
strSql = strSql & ";"
Print #i, strSql
RowIndex = RowIndex + 1
Loop
Next RowIndex |
Partager