IF Activecell

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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)
 
Back
Top