IF Activecell

G

Guest

I have a global matrix, 36 columns x 24 rows, made up of 6 – 12 x 12 sub
matrices.
I want to write a macro that will determine which 12 x 12 RANGE contains the
ACTIVECELL and then REPLACE a specific value in that sub matrix.

I have tried to write nested IF statements e.g.
IF(Activecell()<(“M13â€),Range(“A1:L12â€),IF(Activecell()<(“Y13â€)…etc
But each variation I make still fails with syntax or compile errors.
Can anyone please help

Rewop Eilsel
 
B

Bob Phillips

If Not Intersect(ActiveCell, Range("Matrix1")) Is Nothing Then
MsgBox "Matrix 1"
ElseIf Not Intersect(ActiveCell, Range("Matrix2")) Is Nothing Then
MsgBox "Matrix 2"
ElseIf Not Intersect(ActiveCell, Range("Matrix3")) Is Nothing Then
MsgBox "Matrix 3"
ElseIf Not Intersect(ActiveCell, Range("Matrix4")) Is Nothing Then
MsgBox "Matrix 4"
ElseIf Not Intersect(ActiveCell, Range("Matrix5")) Is Nothing Then
MsgBox "Matrix 5"
ElseIf Not Intersect(ActiveCell, Range("Matrix16")) Is Nothing Then
MsgBox "Matrix 6"
'etc.
End If

What happens if it is in more than one?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top