Need help on continuous running of a macro

cushal

New Member
Joined
Mar 24, 2009
Messages
9
Hello all,

I have an elementary level macro which basically opens a hyperlink when the number in a cell changes. The problem for me is though that I cant get the macro to be running continuously and it gets executed only when I run it myself each and every time. I basically need for the macro to be constantly on and execute the hyperlink each time the cell value changes. I looked up on the internet and it asked me to access the private Worksheet object and put in the code in Private Sub Worksheet_Change(ByVal Target As Range). How exactly do I access this object? Any help would be greatly appreciated.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Right-click the sheet name, go to view code.

Inside the following tags, put your code:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)

End Sub

Note that whatever cell(s) was (were) changed are 'Target'. If you only want to, for instance, have your macro activate when Cell A1 is changed, you can add the following around your code:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target,Range("A1")) Is Nothing Then
        'Insert Macro Here
    End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,693
Members
449,048
Latest member
81jamesacct

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