VB: fix for column designation & add \'OR\' variables to test for hi, i am tryin
ID: 3564155 • Letter: V
Question
VB: fix for column designation & add 'OR' variables to test for
hi, i am trying to get multiple values to be 'OR' 'ed into 1 expression, if i typed that right..
for = "2" is there a way to add to the line for other values? eg: "A" "B" "T"
(to see if can answer here, else can enter as separate post), thanks.
----------
old: i am trying to solve the following for referencing a workcell that has the value: BI:BI in cell Q7.
(thanks for the posts, i have some catching up to do).
If Cells(ActiveCell.Row, RANGE(Q7).Column).Value = "2" Then 'how do i 'OR' variables in with "2" eg: "A" "B" etc
'If Cells(ActiveCell.Row, RANGE(Q7).Column).Value = "2" Then 'update: ANSWER this seems to be working now..
'If Cells(ActiveCell.Row, "BI").Value = "2" Then 'yes do for Q7
'If Cells(ActiveCell.Row, "BI:BI").Value = "2" Then 'yes do for Q7
Any suggestion??
Explanation / Answer
You are one level shallow of the degree of nesting you require. I'll add the .Value property to help demonstrate.
If Cells(ActiveCell.Row, Range(Range("Q7").Value).Column).Value = 2 then
Hope this help:-)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.