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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top