Live-Forum - Die aktuellen Beiträge
Datum
Titel
24.04.2024 19:29:30
24.04.2024 18:49:56
Anzeige
Archiv - Navigation
800to804
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
800to804
800to804
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

Suche nach Verknüpfungen

Suche nach Verknüpfungen
14.09.2006 08:23:29
Nicoletroler
Hallo zusammen,
ich habe hier eine Datei von einem Kollegen übernommen, in der Verknüpfungen sein sollen. Über das Menü "Bearbeiten/Verknüpfungen" kann ich diese auch sehen. Nun möchte ich wissen, in welcher der Zellen die Verknüpfung enthalten ist. Eine Suche nach dem Dateinamen, wobei ich "in Formeln" angeklickt habe, bringt mich hier nicht weiter. Wer weiß, wo sich diese Verknüfungen verbergen können?
Gruß von Nicole

6
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Suche nach Verknüpfungen
14.09.2006 08:35:36
egres
Hi Nicole
Es könnte sich auch um Zellennamen die in Bezug auf eine andere Datei sind sein.
Schau mal unter Einfügen/Namen/Festelegen die Bezuge an und lösche die unnötigen!
Grsuu Egres
AW: Suche nach Verknüpfungen
14.09.2006 09:07:23
Nicoletroler
Hallo Egres,
ja, da habe ich tatsächlich was gefunden. Habe es gelöscht. Es gibt aber immer noch unter dem Menüpunkt Verknüpfen Einträge, die ich löschen möchte, aber noch nicht gefunden habe.
Gruß von Nicole.
AW: Suche nach Verknüpfungen
15.09.2006 20:53:02
egres
Hallo Nicole
suche in der Hilfe unter "Suchen nach Verknüpfungen in einer Arbeitsmappe", da kannst du auch noch Angaben finden!
Gruss Egres
AW: Suche nach Verknüpfungen
15.09.2006 20:57:21
Josef
Hallo Nicole!
Füge den folgenden Code in ein allgemeines Modul deiner Datei ein und starte das Makro "FindLinks", damit solltest du alle versteckten Verknüpfungen aufspüren und löschen können.
' **********************************************************************
' Modul: Modul2 Typ: Allgemeines Modul
' **********************************************************************

Option Explicit
Dim iFound As Integer

'
'Quelle unbekannt Wenn jemand diesen Code erkennt und den Author kennt,
' bitte mitteilen! j.ehrensberger@aon.at
'
'Source unknown If someone recognizes this code and knows the Author,
' please tell me! j.ehrensberger@aon.at
'

Private Function CheckDelete(Where As String, What As String)
Dim iResp As Integer
iFound = iFound + 1
iResp = MsgBox("Found a link in " & Where & ":" & Chr(10) & What & Chr(10) & "Shall I delete it?", vbYesNoCancel, "Link Finder")
Select Case iResp
  Case vbCancel
    Application.StatusBar = False
    End
  Case vbYes
    CheckDelete = True
  Case vbNo
    CheckDelete = False
End Select
End Function




Sub FindLinks()
Dim obj As Object, oSheet As Object, oSeries As Object
Dim iOLEfound As Integer, stMsg As String
Dim rCell As Range, rFirst As Range, rToDo As Range
Dim rDone As Range, rAll As Range, rArea As Range
Static LinkString As String

iFound = 0

If IsEmpty(ActiveWorkbook.LinkSources()) Then
  MsgBox "There are no links from this workbook"
  Exit Sub
End If
LinkString = InputBox("Name of file to which links refer?" & _
  Chr(10) & "Do not include path if file is open", Default:=LinkString, _
  Title:="Link Finder")
If LinkString = "" Then Exit Sub

Application.StatusBar = "Looking for links in workbook names"

' first look for names
For Each obj In ActiveWorkbook.Names
  If InStr(obj.RefersTo, LinkString) > 0 Then
    stMsg = ""
    If obj.Visible = False Then stMsg = stMsg & "hidden "
    If CheckDelete(stMsg & "name " & obj.Name, obj.RefersTo) Then obj.Delete
  End If
Next obj

' now scan each sheet in turn
For Each oSheet In ActiveWorkbook.Sheets
  Application.StatusBar = "Looking for links in sheet " & oSheet.Name
  iOLEfound = 0
  If TypeName(oSheet) <> "Module" Then
    For Each obj In oSheet.DrawingObjects
      
      ' any drawing object could be linked to a macro
      If InStr(obj.OnAction, LinkString) > 0 Then
        If CheckDelete("OnAction of " & TypeName(obj) & " '" & obj.Name & "' in " & oSheet.Name, obj.OnAction) Then obj.OnAction = ""
      End If
      
      ' some drawing objects have formula properties
      Select Case TypeName(obj)
          
        Case "TextBox", "Picture", "Button"
          If InStr(obj.Formula, LinkString) > 0 Then
            If CheckDelete("formula of " & TypeName(obj) & " '" & obj.Name & "' in " & oSheet.Name, obj.Formula) Then obj.Formula = ""
          End If
          
        Case "OLEObject"
          ' can't get to the formula of an OLEObject - so report at end
          iOLEfound = iOLEfound + 1
          
        Case "ChartObject"
          For Each oSeries In obj.Chart.SeriesCollection
            If InStr(oSeries.Formula, LinkString) > 0 Then
              If CheckDelete("series " & oSeries.Name & " in Chart " & obj.Name & " on sheet " & oSheet.Name, oSeries.Formula) Then oSeries.Formula = ""
            End If
          Next oSeries
      End Select
    Next
    If TypeName(oSheet) = "Worksheet" Then
      ' look in cell formulae
      Application.ScreenUpdating = False ' otherwise screen flashes
      Set rCell = Nothing
      On Error Resume Next
      Set rCell = oSheet.UsedRange.Find(LinkString, oSheet.UsedRange.Range("A1"), xlFormulas, xlPart, xlByRows, xlNext)
      On Error GoTo 0
      If Not rCell Is Nothing Then
        Set rFirst = rCell
        Set rAll = rCell
        Do
          Set rCell = oSheet.UsedRange.FindNext(rCell)
          Set rAll = Union(rAll, rCell)
        Loop Until rCell.Address = rFirst.Address
        Application.ScreenUpdating = True
        
        For Each rArea In rAll.Areas
          Set rDone = rArea.Cells(1, 1)
          Set rToDo = rArea.Cells(1, 1)
          Do
            For Each rCell In rArea.Cells
              If Intersect(rDone, rCell) Is Nothing Then
                If rToDo Is Nothing Then
                  Set rToDo = rCell
                ElseIf rCell.FormulaR1C1 = rToDo.Cells(1, 1).FormulaR1C1 Then
                  Set rToDo = Union(rToDo, rCell)
                End If
              End If
            Next rCell
            stMsg = "cell "
            If rToDo.Cells.Count > 1 Then stMsg = "cells "
            If CheckDelete(stMsg & oSheet.Name & "!" & rToDo.Address, rToDo.Range("A1").Formula) Then
              rToDo.Formula = rToDo.Value
            End If
            Set rDone = Union(rDone, rToDo)
            Set rToDo = Nothing
          Loop Until rDone.Address = rArea.Address
        Next rArea
      End If
    ElseIf TypeName(oSheet) = "Chart" Then
      ' look in chart series
      For Each oSeries In oSheet.SeriesCollection
        If InStr(oSeries.Formula, LinkString) > 0 Then
          If CheckDelete("series " & oSeries.Name & " in Chart " & _
            obj.Name, oSeries.Formula) Then oSeries.Formula = ""
        End If
      Next oSeries
    ElseIf TypeName(oSheet) = "DialogSheet" Then
      ' look in on action of dialog frame
      If InStr(oSheet.DialogFrame.OnAction, LinkString) > 0 Then
        If CheckDelete("dialog frame of " & oSheet.Name, oSheet.DialogFrame.OnAction) Then oSheet.DialogFrame.OnAction = ""
      End If
    End If
  End If
  If iOLEfound = 1 Then
    MsgBox "There is an OLE Object on sheet " & oSheet.Name & " which I could not check"
    oSheet.OLEObjects.Select
  ElseIf iOLEfound > 1 Then
    MsgBox "There are " & iOLEfound & " OLE Objects on sheet " & oSheet.Name & " which I could not check"
    oSheet.OLEObjects.Select
  End If
Next oSheet
If iFound = 0 Then MsgBox "No links found to " & LinkString, vbInformation, "Link Finder"
Application.StatusBar = False
End Sub


Gruß Sepp

Anzeige
AW: OT Codeherkunft
16.09.2006 10:02:21
Josef
Hallo Reinhard!
Danke!
Gruß Sepp

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige