Reposted : VBA CODE FOR TABLE FORMATTING

Status
Not open for further replies.

shoun2502

New Member
Joined
Nov 14, 2018
Messages
45
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I need a help with the below mentioned code. As the code runs well . Further I need to incorporate the following points.


1. Outside border as Color white
2. In table alternate rows RGB (211 217 222). I meant 1, 3, 5 ROWS etc.
3. 2, 4, 6 rows as .Interior.Color = RGB(234, 237, 239)


Keeping the below formatting intact.


Sub All_Tables_All_Sheets_New()
Dim T As ListObject
Dim c As Long
Dim i As Long
For i = 1 To Sheets.Count
For Each T In Sheets(i).ListObjects
With T.DataBodyRange
c = .Columns.Count
.Interior.Color = RGB(234, 237, 239)
.Font.Size = 11
.Name = "Calibri"
.Font.Color = RGB(89, 89, 89)
.Columns(1).Interior.Color = RGB(0, 39, 77)
.Columns(1).Font.Color = vbWhite
.Columns(1).Font.Bold = True
.Rows(1).Interior.Color = RGB(0, 39, 77)
.Rows(1).Font.Color = vbWhite
.Rows(1).Font.Bold = True
.Rows.Borders.LineStyle = xlContinuous
.Rows.Borders.Color = vbWhite
.Rows.Borders.Weight =3
End With
Next
Next
End Sub


I look forward to having your support on the same.

Regards
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Status
Not open for further replies.

Forum statistics

Threads
1,223,992
Messages
6,175,829
Members
452,673
Latest member
LaMiaAvy

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