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

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
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,215,537
Messages
6,125,384
Members
449,221
Latest member
DFCarter

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