Macro to do text shading
How is it possible to shade a text with the cursor by using a macro? The shading must be done by holding down the left mouse button and moving the cursor over the text. I cannot find the VBA code to do this.
Thank you.
Web Development
How is it possible to shade a text with the cursor by using a macro? The shading must be done by holding down the left mouse button and moving the cursor over the text. I cannot find the VBA code to do this.
Thank you.
by peyison
Here is a macro that will shade the current selection, but you still have to invoke it manually.
Sub ShadeSelection()
With Selection.Interior
.ColorIndex = 15
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic End With
End Sub
Paste the above macro into a code module.
Assign a shortcut key to the macro (like CTRL+s):
Select Tools-> Macro-> Macros, select ShadeSelection, and press options.
To use it, select the cells to highlight, then press CTRL+s.
Hope this helps.
This discussion is closed to new replies.
Sort by Trending