How do I declare a global variable in VBA?

前端 未结 8 1090

I wrote the following code:

Function find_results_idle()

    Public iRaw As Integer
    Public iColumn As Integer
    iRaw = 1
    iColumn = 1
8条回答
  •  一生所求
    2020-11-22 09:08

    Also you can use -

    Private Const SrlNumber As Integer = 910
    
    Private Sub Workbook_Open()
        If SrlNumber > 900 Then
            MsgBox "This serial number is valid"
        Else
            MsgBox "This serial number is not valid"
        End If
    End Sub
    

    Its tested on office 2010

提交回复
热议问题