Consulting

Results 1 to 1 of 1

Thread: Code to select current open workbooks under ComboBox n Userform

  1. #1
    VBAX Newbie
    Joined
    Jul 2015
    Posts
    1
    Location

    Code to select current open workbooks under ComboBox n Userform

    Hi Friends,

    I am completely new to coding in vba. I have currently written the below code for selecting workbook to be used for running the macro. However even though the workbooks are open I do not see it under the combobox drop down. Could you please suggest what needs to be done in order to be able to see the current open workbooks under the combobox drop down.

    Option Explicit
     
    Private Sub ComboBox1_Change()
        With ComboBox1
                Label1.Caption = "Fees Template"
                    End With
    Dim Wkbk As Workbook
     
    Wkbk = FeesTemplate("csv files, *.csv")
    If Wkbk = False Then MsgBox "Please select the correct File"
    Else
    Private Sub ComboBox2_Change()
        With ComboBox2
                Label2.Caption = "Formatted"
                    End With
    Dim Wkbk As Workbook
     
    Wkbk = Formatted("csv files, *.csv")
    If Wkbk = False Then MsgBox "Please select the correct File"
    End If
    End If
    End Sub
    End Sub
    Last edited by Aussiebear; 07-28-2015 at 04:28 PM. Reason: reposted the code within the correct tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •