Hallo Rainer,
wie oben gesagt: ich meine mich zu erinnern, das ich schon mal einen Hinweis auf ein bereits vorhandenes Makro irgendwo gelesen hätte.
Die Frage ist also erstmal ob meine Erinnerung stimmt und dann ob jemand weis wo es zu finden ist. Auf dieser Seite habe ich schon mal das folgende gefunden:
www.office-loesung.de/ftopic30827_0_0_asc.php
Sub RelativeBezuege()
Dim myRange As Range
For Each myRange In Selection
If myRange.HasFormula Then
If myRange.HasArray Then
If Application.ReferenceStyle = xlR1C1 Then
myRange.FormulaArray = Application.ConvertFormula(myRange.Formula, xlR1C1, , xlRelative)
Else
myRange.FormulaArray = Application.ConvertFormula(myRange.Formula, xlA1, , xlRelative)
End If
Else
If Application.ReferenceStyle = xlR1C1 Then
myRange.Formula = Application.ConvertFormula(myRange.Formula, xlR1C1, , xlRelative)
Else
myRange.Formula = Application.ConvertFormula(myRange.Formula, xlA1, , xlRelative)
End If
End If
End If
Next
End Sub
Relative in absolute:
Code:
Sub AbsoluteBezuege()
Dim myRange As Range
For Each myRange In ActiveSheet.UsedRange
If myRange.HasFormula Then
If myRange.HasArray Then
If Application.ReferenceStyle = xlR1C1 Then
myRange.FormulaArray = Application.ConvertFormula(myRange.Formula, xlR1C1, , xlAbsolute)
Else
myRange.FormulaArray = Application.ConvertFormula(myRange.Formula, xlA1, , xlAbsolute)
End If
Else
If Application.ReferenceStyle = xlR1C1 Then
myRange.Formula = Application.ConvertFormula(myRange.Formula, xlR1C1, , xlAbsolute)
Else
myRange.Formula = Application.ConvertFormula(myRange.Formula, xlA1, , xlAbsolute)
End If
End If
End If
Next
End Sub
Für mich sieht das aber so aus als ob man das noch deutlich kürzen könnte. (ich arbeite nicht mit der R1Z1-Bezugsart)
mfg
Wolfgang