AW: Naja, GCS würde ich nicht sagen, da ich...
10.06.2009 12:55:16
AnRo
Hallo Luc,
vielen Dank fuer deine Antwort. Damit das raten ein Ende hat, anbei mein Quelltext. Wahrscheinlich habe ich den Fehler mit "ThisWorkbook.Sheets" gemacht, jedoch weiss ich nicht, wie ich dies loesen kann. Alle Leute haben zugriff auf einen zentralen Server, wo ich eine Datei ablegen koennte.
Option Explicit
Dim aRow As Long
Dim col As New Collection
Dim iRow, x As Long
Dim strFileName As Long
Private Sub ComboBox1_Change()
ComboBox2.Clear
ComboBox3.Clear
On Error Resume Next
For iRow = 2 To aRow
col.Add Cells(iRow, 2), Cells(iRow, 2)
If Err = 0 And Cells(iRow, 1) = ComboBox1.Value Then
ComboBox2.AddItem Cells(iRow, 2)
Else
Err.Clear
End If
Next iRow
On Error GoTo 0
For x = col.Count To 1 Step -1
col.Remove (x)
Next x
End Sub
Private Sub ComboBox2_Change()
Me.ComboBox3.Clear
On Error GoTo Fehler
For iRow = 2 To aRow
If Cells(iRow, 2) = Me.ComboBox2.Value Then
With Me.ComboBox3
.AddItem Cells(iRow, 3)
.List(.ListCount - 1, 1) = iRow
End With
End If
Resume01:
Next iRow
Fehler:
With Err
If .Number 0 Then
Resume Resume01
End If
End With
End Sub
Private Sub ComboBox3_Change()
Dim wks As Worksheet, strDateiName As String
Set wks = ActiveSheet
With Me.ComboBox3
'Dateiname aus Spalte D (4) einlesen
strDateiName = wks.Cells(Val(.List(.ListIndex, 1)), 4)
Application.Dialogs(xlDialogSaveAs).Show strDateiName & "_" & TextBox1 & "_" & Format( _
Now, "YYMM") & "_rev"
End With
End Sub
Private Sub CommandButton1_Click()
Application.Dialogs(xlDialogSaveAs).Show "c:\Meine Abrechnung\LustigerDateiName.xls"
End Sub
Private Sub Label2_Click()
End Sub
Private Sub TextBox1_Change()
End Sub
Private Sub UserForm_Initialize()
aRow = IIf(IsEmpty(Range("A65536")), Range("A65536").End(xlUp).Row, 65536)
On Error Resume Next
For iRow = 2 To aRow
col.Add Cells(iRow, 1), Cells(iRow, 1)
If Err = 0 Then
ComboBox1.AddItem Cells(iRow, 1)
Else
Err.Clear
End If
Next iRow
On Error GoTo 0
End Sub
Vielen Dank fuer die Hilfe.
Andreas