If you would like people to review your code then I'm afraid you will need to post in full - unfortunately working in piecemeal often leads to misinterpretation.
On an aside going back to an early point, quoting your code:
and subsequently your point:

Originally Posted by
JP789
I wasn't sure about declaring the BkStCell, etc as a string but it seemed to work okay and the values it returns work when assigning a range.
In VBA each variable must be declared explicitly, in your code above:
AnEd is declared as Double, all others on that line are Variants
AnEdCell is declared as String, all others on that line are Variants
So for BkStCell etc to be Strings you would need to use
The Variant type can hold anything.
Were BkStCell a String rather than having been a Variant it would still have worked based on what we can see... ie
would set the String to be a Number Stored as Text, and subsequent math operations would simply have coerced the string to a number, eg:
would work given the * operator would coerce BkStCell from String to Number.
To reiterate though, as you can tell from the posts thus far, it's quite difficult given exact advice when we're unable to see the full picture - and / or are unaware as to the nature of the future use of a multitude of given variables etc ...
the more info we have the more likely we are to be able to impart (potentially) useful assistance
Bookmarks