Add pattern using macro

  • Thread starter Thread starter sparky3883
  • Start date Start date
S

sparky3883

Hi All

I was just wondering, is it possible to record a macro that can add
pattern to a cell?

Everytime i need to add a pattern to a cell, i have to go throug
Format|Cells|Patterns and then choose 'Thin Diagonal Stripe'.

It would be alot easier for me if i could record a macro that will d
it for me.

Is this possible?

Thanks in advanc
 
Have you tried recording a macro to do this? Here's the code
you'll get:

With Selection.Interior
.ColorIndex = 0
.Pattern = xlLightUp
.PatternColorIndex = xlAutomatic
End With


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
A non-macro option is to add the Pattern button to one of your existing
toolbars, then float it over the worksheet:

Choose Tools>Customize
Select the Commands tab
Select the Format category
Scroll down the list of commands, to find Patterns
Drag the Patterns button to one of your existing toolbars
Close the Customize dialog box.

Click the dropdown arrow at the right of the Pattern button
Point to the ridged bar at the top of the Pattern palette.
Drag the Pattern palette away from its toolbar, and it will float over
the worksheet.
As you work, you can select a cell, and click a pattern to fill the cell
 
Back
Top