Return boolean as 1 or 0

G

Greg

hi,

how i convert a boolean variable "Header" into numerical value to work in
the following line:
Sheets(wsFrom).UsedRange.Offset(1 - Header, 0).Copy

Thanks
Greg
 
J

Jerry W. Lewis

Arithmetic (such as 1 - Header) coerces a boolean value into a number.
However, in VBA, True coerces to -1, not 1, so you may need 1 + Header.

Jerry
 
Top