Akuini
Well-known Member
- Joined
- Feb 1, 2016
- Messages
- 5,274
- Office Version
- 365
- Platform
- Windows
Anyone knows how to post colored VBA code like this:
I saw it in a post here:
https://www.mrexcel.com/forum/excel...ic-other-specific-characters.html#post4873793
I saw it in a post here:
https://www.mrexcel.com/forum/excel...ic-other-specific-characters.html#post4873793
Code:
[COLOR=darkblue]Private[/COLOR] [COLOR=darkblue]Sub[/COLOR] Worksheet_Change([COLOR=darkblue]ByVal[/COLOR] Target [COLOR=darkblue]As[/COLOR] Range)
[COLOR=darkblue]Dim[/COLOR] Changed [COLOR=darkblue]As[/COLOR] Range, cel [COLOR=darkblue]As[/COLOR] Range
[COLOR=darkblue]Dim[/COLOR] s [COLOR=darkblue]As[/COLOR] [COLOR=darkblue]String[/COLOR], sErrors [COLOR=darkblue]As[/COLOR] [COLOR=darkblue]String[/COLOR]
[COLOR=darkblue]Const[/COLOR] myTarget [COLOR=darkblue]As[/COLOR] [COLOR=darkblue]String[/COLOR] = "C1:C100" [COLOR=green]'<- Change to suit[/COLOR][INDENT][COLOR=darkblue]Set[/COLOR] Changed = Intersect(Range(myTarget), Target)
[COLOR=darkblue]If[/COLOR] [COLOR=darkblue]Not[/COLOR] Changed [COLOR=darkblue]Is[/COLOR] [COLOR=darkblue]Nothing[/COLOR] [COLOR=darkblue]Then[/COLOR]
Application.EnableEvents = [COLOR=darkblue]False[/COLOR]
[COLOR=darkblue]With[/COLOR] CreateObject("VBScript.RegExp")
[/INDENT]