AW: Aktivierung einer anderen Tabelle
24.09.2004 12:51:13
Paul
Hallo Udo,
aktiv sollten zwei Mappen sein, und zwar die Quelldatei WBStandortziele und die Zieldatei WBRisiko. Die Variable soll auf ein Sheet in der Zieldatei verweisen; Name=Standort
Vielleicht noch der von mir verwandte Code:
Option Explicit
Private WBStandortziele As Workbook
Private WBRisiko As Workbook
Private fNameStandort As String
Private headsheetStandort As String
Private headsheetRisiko As String
Sub StandortzieleExists()
Dim WBStandortzieleExists As Boolean
Dim oWorkbook As Object
'prüfen, ob datei geöffnet ist
WBStandortzieleExists = False
Application.DisplayAlerts = False
With Application
For Each oWorkbook In .Workbooks
If UCase$(oWorkbook.Name) = "StandortzieleGJ04_05.xls" Then
'jetzt aktivieren
Windows(oWorkbook.Name).Activate
Application.DisplayAlerts = True
WBStandortzieleExists = True
Exit For
End If
Next
End With
'Mappe neu laden
If Not WBStandortzieleExists Then
On Error Resume Next
Workbooks.Open Filename:="F:\03_controlling\08_Risk_Management\Projekt_BSC_RM\Meixner\mail BA\praktische Umsetzung\StandortzieleGJ04_05.xls", ReadOnly:=False
On Error GoTo 0
End If
Set WBStandortziele = ActiveWorkbook
Sheets("Overview").Activate
'rote Wert rausfiltern
'If Cells(44, 13) < Cells(48, 13) Then Cells(44, 13).Select
'Selection.Copy Destination:=Workbooks("WBRisiko").Worksheets("Standort").Cells(8, 3)
If Cells(44, 13) < Cells(48, 13) Then _
Cells(44, 13).Copy Destination:=Workbooks("WBRisiko").Worksheets("Standort").Cells(8, 3)
ActiveSheet.Cells(8, 3).Paste
End Sub