mit dieser makro kann ich eine tabelle als text speichern:
Private Sub CommandButton1_Click()
'AlsTextSpeichern
Dim rng As Range
Dim iFile As Integer, iRow As Integer, iCol As Integer
Dim sFile As String, sTxt As String
Set rng = Range("A1").CurrentRegion
iFile = FreeFile
sFile = "c:\wSearch.txt"
Open sFile For Output As iFile
For iRow = 1 To rng.Rows.Count
For iCol = 1 To rng.Columns.Count
Select Case iCol
Case 1, 2, 3, 4, 5
sTxt = sTxt & Cells(iRow, iCol).Text & ";"
Case 6, 7, 8, 9, 10
sTxt = sTxt & Cells(iRow, iCol).Text
End Select
Next iCol
Print #iFile, sTxt
sTxt = ""
Next iRow
Close
Workbooks.OpenText _
Filename:=sFile, _
DataType:=xlDelimited, _
Tab:=False, _
Semicolon:=True, _
Comma:=False, _
Space:=False, _
Other:=False
Columns.AutoFit
MsgBox "Weiter"
ActiveWorkbook.Close savechanges:=False
Range("A1").Select
End Sub
meine frage ist:
an welcher stelle kann ich vor dem gepeichertem text zb: "hier vor text"
und an welcher stelle kann ich nach dem gespeichertem text zb: "hier nach dem text"
diese zusatzangaben mit einschreiben lassen.
dank im voraus
gruss
mehmet