folgendes Makro formatiert die Daten in einem Excel Arbeitsblatt und speichert das Ergebnis in einer Datei. Jedoch tut es dies immer nur fuer das erste Arbeitsblatt in meiner Datei (Sheets(1).Select). Wie kann ich dafuer sorgen, dass das Makro alle Arbeitsblaetter in meiner Datei durchlaeuft?
Danke duer die Hilfe
Sub Format()
Sheets(1).Select
Dim K As String
Dim I As Integer
Dim J As Integer
Dim F As String
Dim AN As String
Dim L As Double
Dim M As Integer
Dim fn As String
Dim K1 As String
Dim IntegerPortion As String
Dim DecimalPortion As String
I = 3
Do While Format(Cells(I, 1)) ""
J = 1
F = Format(Cells(2, 1))
Do While F ""
AN = Left(F, 1)
L = Val(Right(F, Len(F) - InStr(F, "-")))
M = (L - Round(L, 0)) * 10
Select Case AN
Case "N"
K1 = Format(Cells(I, J), String(L, "0"))
If Len(K1) > L Then K1 = Left(K1, L)
If K1 = "" Then K1 = String(L, "0")
Case "D"
IntegerPortion = Format(Int(Abs(Cells(I, J))), String(L, "0"))
DecimalPortion = Format(Abs(Cells(I, J)) - IntegerPortion, "0." & String(M, "0"))
DecimalPortion = Right(DecimalPortion, Len(DecimalPortion) - 2)
K1 = IntegerPortion & DecimalPortion
If Len(K1) > L + M Then K1 = Left(K1, L + M) Else K1 = String(L + M - Len(K1), "0") _
_
+ K1
If K1 = "" Then K1 = String(L + M, "0")
Case "A"
K1 = Format(Cells(I, J))
If Len(K1) > L Then K1 = Left(K1, L) Else K1 = K1 + Space(L - (Len(K1)))
If K1 = "" Then K1 = Space(L)
Case "S"
IntegerPortion = Format(Int(Abs(Cells(I, J))), String(L, "0"))
DecimalPortion = Format(Abs(Cells(I, J)) - IntegerPortion, "0." & String(M, "0"))
DecimalPortion = Right(DecimalPortion, Len(DecimalPortion) - 2)
K1 = IntegerPortion & DecimalPortion
If Len(K1) > L + M Then K1 = Left(K1, L + M) Else K1 = String(L + M - Len(K1), "0") _
_
+ K1
If Cells(I, J)