0

I'm new to VBA and would really appreciate any guidance on how to perform the following VBA Worksheet Change Event.

What I'm trying to carry out is the following: If I change a cell value in a particular column, I want to extract a different cell value within that row into a different worksheet.

So every time a cell value is updated or added to the worksheet, I will automatically extract data and transfer it to the first empty row of the table in a different worksheet.

Please advise! Any insight would be greatly appreciated. Thanks in advance

Update: Figured it out now.

    Private Sub Worksheet_Change(ByVal Target As Range)

    Dim Lastrow2 As Long
    Dim c As Range

Lastrow2 = Worksheets("Action Sheet").UsedRange.Rows.Count

Application.EnableEvents = False
For Each c In Target
    If c.Column = 16 Then
    Worksheets("Action Sheet").Cells(Lastrow2 + 1, 1).Value = Target.Value
    End If

Next c
Application.EnableEvents = True
End Sub
Community
  • 1
  • 1
Riley Hun
  • 2,541
  • 5
  • 31
  • 77
  • You will need to do a worksheet_change event. – Scott Craner Jan 29 '16 at 22:43
  • Also, welcome to SO. In general SO is not a code for me site. If you have tried something, anything, post it in your original post so we may help with specific problems. You are more likely to get help if you show you have tried – Scott Craner Jan 29 '16 at 23:00
  • Write some code for us. I'd go to the VBE, select(double-click) the codesheet which you'd like to have the effect. Then select change from the dropdown at the top. Then you get the worksheet_change evnt sub with a target parameter. Fill in the sub so that the value of target ts tranfered to the data worksheet – MacroMarc Jan 29 '16 at 23:08
  • Hi all, I figured it out...My code is in my original post. – Riley Hun Jan 30 '16 at 02:07

0 Answers0