Hi everybody,
I have just started learning Visual Basic so I would like to ask your help because I couldn't find a tutorial that solves my problem. I would like to write a macro that write a specified number into a specified cell if the active cell is within a range. I would like to use this number as a trigger to control other things such as conditional formatting.
I give you a concrete example:
If I click anywhere within A1 and G1 then I would like the macro to write "1" into J1 (for instance). But if I click anywhere between A2 and G2 then I would like to get number "2" in J1 and so on. I want J1 to be left blank if I click outside of these ranges (A1:G1, A2:G2, etc.).
I am not a native English speaker so if something is not clear then I try to explain in other words.
Thank you for your help in advance guys.
I have just started learning Visual Basic so I would like to ask your help because I couldn't find a tutorial that solves my problem. I would like to write a macro that write a specified number into a specified cell if the active cell is within a range. I would like to use this number as a trigger to control other things such as conditional formatting.
I give you a concrete example:
If I click anywhere within A1 and G1 then I would like the macro to write "1" into J1 (for instance). But if I click anywhere between A2 and G2 then I would like to get number "2" in J1 and so on. I want J1 to be left blank if I click outside of these ranges (A1:G1, A2:G2, etc.).
I am not a native English speaker so if something is not clear then I try to explain in other words.
Thank you for your help in advance guys.