Regarding this macro - I have the following which updates pretty well. But I do have one more question:
Dim lastrow As Long, lastrowi As Long
Application.ScreenUpdating = False
Set shvalues = Sheets("Values")
lastrow = shvalues.Cells(shvalues.Rows.Count, "B").End(xlUp).Row
For j = 4 To lastrow
If shvalues.Cells(j, 6) <> "" Then
findkey = shvalues.Cells(j, 2).Text & shvalues.Cells(j, 3).Text & shvalues.Cells(j, 4).Text
For i = 2 To Worksheets.Count
With Worksheets(i)
lastrowi = .Cells(.Rows.Count, "B").End(xlUp).Row
For ii = 1 To lastrowi
keyii = .Cells(ii, 2).Text & .Cells(ii, 3).Text & .Cells(ii, 4).Text
If keyii = findkey Then
.Cells(ii, 6) = shvalues.Cells(j, 6)
End If
Next ii
End With
Next i
End If
Next j
Application.ScreenUpdating = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("F5:F500")) Is Nothing Then UpdatePrice
End Sub
My question is if I want to expand the number of columns that will update, how do I do that. For example, if I want the macro to update based on changes to column s F G H, what changes do I make in the code?
Bookmarks