VBA - Do action if table changes

cozzagiorgi

New Member
Joined
Jun 27, 2018
Messages
41
Hi,

I am working on a (seemingly) simple macro wich should look if my "Tabelle1" is changed. If yes, it should do something. This is my macro, but I get a Runtime error 424, what am I doing wrong?



Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Count <> 1 Then Exit Sub


    If Not Intersect(Target, ["Tabelle1"[]]) Is Nothing Then


        Application.EnableEvents = False
    Range("H2").Select
    Selection.Copy
    Range(Selection, Selection.End(xlDown)).Select
    ActiveSheet.Paste
    Range("A2").Select
    Selection.End(xlDown).Select


End If


Application.EnableEvents = True


End Sub

Thanks for your help!
 
I have only one script of this type in this sheet, so that shouldn't be a problem.

What I am trying to do is:
Watch Range F:F of Tabelle1, if there are any changes in F:F it clears range H:H and writes a new formula in order to update my data. Thats all.

Clearing the range, writing the formula etc works. But I don't know how I can tell VBA to do that only when there are changes in the range F:F.
 
Upvote 0

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
There is only one of those scripts on this sheet. So no problem there :-)

I want to watch range F:F, if something changes in this range it clears range H:H and puts a formula in there.

The clearing and the formula are not a problem. But I just cant get it to watch the range F:F, right now it watches the complete sheet.
 
Upvote 0
This is beyond my knowledgebase.
I will continue to monitor this thread to see what I can learn.
 
Upvote 0
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,304
Members
452,633
Latest member
DougMo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top