Microsoft Office Forums


Reply
Thread Tools Display Modes

VBA Syntax problem

 
 
JP
Guest
Posts: n/a

 
      03-09-2010, 08:47 AM
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

 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a

 
      03-09-2010, 10:46 AM
Try

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

run macro code
End If

--

HTH

Bob

"JP" <(E-Mail Removed)> wrote in message
news19033E5-F23A-4C11-B87E-(E-Mail Removed)...
>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
>



 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
crosstab query problem Ramesh Access Newsgroup 7 03-13-2010 04:50 PM
Import: Problem on "Predecessor" field. Emmanuel REGIS Project Newsgroup 3 02-24-2010 08:05 PM
PowerPoint automation problem Wolfgang PowerPoint Newsgroup 0 02-21-2010 03:29 PM
Problem with Access snapshot 2007 DRD Access Newsgroup 0 02-19-2010 03:43 PM
Video Problem - No sound when playing harleyfiremedic PowerPoint Newsgroup 6 02-18-2010 10:11 PM



All times are GMT. The time now is 02:07 PM.