VB

sullyman4

Board Regular
Joined
Nov 8, 2004
Messages
151
Slow day today so I was looking at old "you know your and excel guru..................

and I came across this.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = 7 Then Target = 4
End Sub


What is it and how do i use it??
 

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.

Lewiy

Well-known Member
Joined
Jan 5, 2007
Messages
4,284
It is a VBA event code. When a 7 is entered into a cell, it will automatically change it to a 4.
To use it, right click on the worksheet tab and select "View Code". Paste the code into the screen which pops up.
 

Forum statistics

Threads
1,191,499
Messages
5,986,920
Members
440,065
Latest member
JCH136

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
Top