running formula in excel ( VBA )

G

grizzly6969

If I use vba to create a running total and save and close my worksheet the
formula will not work unless I set macros to low security setting. I share
the computer and do not want the security left on low.
Is there a way to save the worksheet and leave macros security setting to
remain on high and only allow this worksheet to work
this is the formula I have been working with

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Dim rng As Range
' Only look at single cell changes
If Target.Count > 1 Then Exit Sub
Set rng = Target
' Only look at that range
If Intersect(Target, rng) Is Nothing Then Exit Sub
' Add A2's value to B2
Target.Offset(0, 1).Value = Target.Offset(0, 1).Value + Target.Value
Application.EnableEvents = True
End Sub
 
S

Shane Devenshire

Hi,

Make the location of the file a trusted location and then enable macros
opened from that location. (Security level Very High - 2002? and later)

If this helps, please click the Yes button

Cheers,
Shane Devenshire
 

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