PDA

View Full Version : Learning VBA Variables



bloodmilksky
01-09-2017, 05:53 AM
Hi Guys,

I was wondering if anyone can help me I was wondering how I would set up a variable that would determine the amount of cells to check for in a range depending on the value entered into a Cell

So if Value X Was entered into Cell A1 it would Check For 2 occurrences of A Value
And If Value Y Was entered Into Cell A1 It would Check For 1 occurence of The Same Value?

I appologise if this is vague but am trying to learn how to implement new variables into a subroutine and am really struggling.

many thanks

jamie

Paul_Hossler
01-09-2017, 09:21 AM
Can you attach a small example workbook?

offthelip
01-09-2017, 11:01 AM
Your question is ambiguous, you state:
"determine the amount of cells to check for in a range"

Later you state:
"Check For 2 occurrences of A Value "

Are you wanting to set up a variable to change the size of a range?

or are you trying to set up a variable to check for the number of occurences of a search?


or both? In which case you will need two variables