why is it saying sheetcnt is "variable not defined" how to do a global
variable to share over multiple functions in vba for excel?

Dim sheetcnt As Integer
Private Sub cmdImport_Click()
sheetcnt = 1