Return boolean as 1 or 0

  • Thread starter Thread starter Greg
  • Start date Start date
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
 
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
 
Back
Top