VBA Syntax problem

J

JP

I am trying to set up a macro which would only run if there is a value in
any of the three cells to the left of active cell. The following does not
seem to work and would appreciate any help in correcting this:

If ActiveCell.FormulaR1C1 = "(SUM(RC[-3]:RC[-1])<>0" Then
run macro code
End If

JP
 
B

Bob Phillips

Try

If Application.Counta(Activecell.Offset(0, -3).Resize(, 3)) > 0 Then

run macro code
End If
 

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

Similar Threads


Top