VB codes

  • Thread starter Thread starter Val
  • Start date Start date
V

Val

How do you update/append/delete records in various files automatically based
on the entry into the Summary file.
 
Your question is rather vague, but the core of the answer is to use
the Change event to execute the appropriate code when a value on the
Summary sheet is changed. Right-click on the sheet tab of your Summary
sheet and choose View Code. In the code module that opens up, enter

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Cells.Count > 1 Then
Exit Sub
End If
If Not Application.Intersect(Range("A1:A10"), Target) Is Nothing Then
' your code here
End If

End Sub

This code will be automatically exectued when a value on the worksheet
is changed. The code test whether the cell that was changed (Target)
is within the range A1:A10 and if so then executes whatever you put in
the line ' your code here.

The Change event is triggered when a cell's value changes as the
result of the user typing in a cell or as the result of other VBA code
modifying the value, but not if the change is simply the result of a
calculation.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional,
Excel, 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
 
Back
Top