saving worksheet automatically

M

MIke

I am using the following function to save changes after any data is entered
into a worksheet:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
ActiveWorkbook.Save
End Sub

Is there a way to use auto save only if data is entered in a certain range?

Thanks for the help,
Mike
 
D

Dave Peterson

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

dim myRng as range
set myrng = me.range("a1,c3,e5:j17")

if myrng.cells.count = application.counta(myrng) then
me.parent.save
end if

End Sub
 
M

MIke

Dave,

I am getting a Compile error that reads Method or data member not found. I
changed the range to ("B7:S38"). I am not sure what the problem is.
Thanks for the help,
Mike
 
Top