InputBox İle Çalışma Kitabı Aç - Microsoft Excel


InputBox üzerinden açılacak çalışma kitabının tam yolu girildiğinde o çalışma kitabını açan bir sub yordamdır.

Kod


Option Explicit

Sub CalismaKitabiAc()
    Dim kitap As String
    Dim soru  As Variant

git:

    kitap = InputBox("Çalışma sayfasının yolunu giriniz:", "DOSYA YOLU")

    If kitap <> "" And Err.Number = 1004 Then
        Workbooks.Open (kitap)
    ElseIf kitap = "" Then
        soru = MsgBox("Boş değer göndermişsiniz." & vbCrLf & _
        "Tekrardan denemek istiyor musunuz?", vbYesNo, "HATA")
        If soru = vbYes Then
            GoTo git
        End If
    Else
        MsgBox "Bir hata oluştu.", vbOKOnly, "HATA"
    End If

End Sub

Etiketler
microsoft excel