Before running code comment out another code

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,226
Office Version
  1. 2007
Platform
  1. Windows
Not sure if i title is correct.

I think its called comment out. Its when the code doesnt run as you put a marker at the front of the code ??

I have a code which as the user works the row they are on changes to Blue & the Cell they are in Green,all the other cells are Yellow until selected etc.

I wish to use a code that will change the cell color when i type in a value to look for.
Textbox or input filed im not sure yet but say i type TOM the code will look withing my range for TOM & change cell color to a color of my choice.
Before i run this code can we comment out the other code using vba ?
The other code being,
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Just saves the user going into the page & doing it manually of which i dont want them to
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Before i run this code can we comment out the other code using vba
No. Your code needs to handle every scenario that you can imagine (and eventually those you did not). Often that is done with IF or Select Case blocks (IF statements or Select Case statements that test for certain conditions and act accordingly).
 
Upvote 0

Forum statistics

Threads
1,215,080
Messages
6,123,013
Members
449,093
Latest member
ikke

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