ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? (https://www.excelbanter.com/excel-worksheet-functions/34538-why-saying-sheetcnt-%22variable-not-defined%22-how-do-global-variable-share-over-multiple-functions-vba-excel.html)

Daniel

why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel?
 
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



David McRitchie

Hi Daniel,

XL: Scope of Variables in Visual Basic for Applications
http://support.microsoft.com/default...;en-us;Q141693

---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Daniel" wrote in message ...
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






All times are GMT +1. The time now is 05:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com