Gruppe
Funktion
Problem
Wie kann ich alle Formeln eines Tabellenblattes mit den jeweils zugehörigen Zelladressen als Textdatei speichern?
StandardModule: basMain
Sub SaveFormulas()
Dim rng As Range
Dim iFile As Integer
Dim sFile As String
sFile = Application.Path & "\formulas.txt"
iFile = FreeFile
Open sFile For Output As iFile
For Each rng In Range("A1").CurrentRegion.Cells
If rng.HasFormula Then
Print #iFile, _
rng.Address; Tab; _
rng.Formula, Tab; _
rng.FormulaLocal
End If
Next rng
Close iFile
Workbooks.OpenText _
Filename:=sFile, _
DataType:=xlDelimited, _
tab:=True, _
semicolon:=False, _
comma:=False, _
Space:=False, _
other:=False
MsgBox "Weiter"
ActiveWorkbook.Close savechanges:=False
Kill sFile
End Sub