Ist wohl ein bisschen umständlich geschrieben und gibt mir auch nen Compilierungsfehler bei "Application.Goto Cells(lonCol, 65536), True". Bin nur "Amateur" und versteh hier meinen Fehler nicht. Das kann man bestimmt auch mit ActiveCell."...".select oder .activate machen, weiss aber nicht wie.
Kann mir jemand helfen.
Sub Workbook_Open()
Dim lonCol As Long, lonRow As Long
Sheets("DATA BASE").Activate
' Find unique identification "ICSN"
Cells.Find(What:="ICSN", After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=True).Activate
' Save Column of "ICSN"
lonCol = ActiveCell.Column
' Goto end of Column (Last entry)
Application.Goto Cells(lonCol, 65536), True <========
Selection.End(xlUp).Select
lonRow = Selection.Row
' Select the Row underneath and replace format of the following ten columns
ActiveCell.Offset(1, 0).Rows("1:1").EntireRow.Select
Selection.Copy
ActiveCell.Offset(1, 0).Rows("1:10").EntireRow.Select
Selection.Paste
Application.CutCopyMode = False
Application.Goto Cells(lonRow, lonCol), True
ActiveSheet.Outline.ShowLevels RowLevels:=0, ColumnLevels:=1
End Sub