Formatting various cells within an array

Dennis Reynolds

New Member
Joined
Jul 12, 2011
Messages
9
I have the general idea on how to do it I just don't know the language for it. I need the borders, indents, font size, and font format to change for various cells. My idea is to create a few format cases and then create a format array with the case names being the entries. Am I on the right path here? My format conditions are below.
With Selection
.IndentLevel = 0
End With
With Selection.Font
.FontStyle = "Standard"
.Size = 10
End With
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlHairline
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlHairline
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlHairline
End With
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
I have the general idea on how to do it I just don't know the language for it. I need the borders, indents, font size, and font format to change for various cells. My idea is to create a few format cases and then create a format array with the case names being the entries. Am I on the right path here? My format conditions are below.

I am not sure I understand but I think you should define those formats as custom Styles - Look up the Style/Styles Topic in the help files.
 
Upvote 0
I am not sure I understand but I think you should define those formats as custom Styles - Look up the Style/Styles Topic in the help files.


Thank you but I think I found my own way using multiple if or then statements to format the varying cells. Not sure if that's the best way to go about it, but it works anyhow. Thank you for your response though!
 
Upvote 0

Forum statistics

Threads
1,224,566
Messages
6,179,551
Members
452,927
Latest member
rows and columns

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