ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hash (#) at start of line in VBA (https://www.excelbanter.com/excel-programming/380172-hash-start-line-vba.html)

[email protected]

Hash (#) at start of line in VBA
 
I've come across several instances of code in which some statements
start with a hash mark/symbol (#). When stepping through the code,
these statements are skipped, as if they were comments.

For example, a line which has:

#Const SkipMe = True

is skipped. So would be:

#If whatever = 1 then
... 'anything in here would be skipped too
#End If

I have searched high and low, but can't figure out what these hash
marks (#) mean.

Any hints or pointers in the right direction?

Many thanks.


[email protected]

Hash (#) at start of line in VBA
 
Makes perfect sense. Thanks for the link and the help.

Cheers,
Kevin

On Dec 28, 11:18 am, Jim Thomlinson
wrote:
The # symbol is a conditional compiler directive. Depending on your system
components, sofware versions or operating system the program will compile
diffrently. Check out this link...

http://msdn2.microsoft.com/en-us/lib...bk(VS.80).aspx
--
HTH...

Jim Thomlinson

" wrote:
I've come across several instances of code in which some statements
start with a hash mark/symbol (#). When stepping through the code,
these statements are skipped, as if they were comments.


For example, a line which has:


#Const SkipMe = True


is skipped. So would be:


#If whatever = 1 then
... 'anything in here would be skipped too
#End If


I have searched high and low, but can't figure out what these hash
marks (#) mean.


Any hints or pointers in the right direction?


Many thanks.




All times are GMT +1. The time now is 04:00 AM.

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