7/6/2023 0 Comments Excel qm add in 2016This assumes you have a number (like 5) in cell D6. MyVariableName = ActiveSheet.Range("D6").Value Try something like this: Dim MyVariableName As Integer I'm assuming you want the value stored in a variable. This could be a integer or a string for example (depends on what you have in that cell) but it's not a range. ![]() This line: Set envFrmwrkPath = ActiveSheet.Range("D6").Value is attempting to set the Range type variable to a specific Value that is in cell D6. This means that you can only set it to a range. This line: Dim envFrmwrkPath As Range is declaring the variable envFrmwrkPath of type Range. ![]() They can be any type, including object, integer, string, or even a variant. The first code line, Option Explicit means (in simple terms) that all of your variables have to be explicitly declared by Dim statements.
0 Comments
Leave a Reply. |