Change Font Size in a table

ManUBlueJay

Active Member
Joined
Aug 30, 2012
Messages
250
Office Version
  1. 2016
Platform
  1. Windows
I am trying to change the font size in a table called TableEntryLog as well as remove any horizontal and vertical lines in the table.
This code does not seem to work

VBA Code:
Sub ChangeFontSize()
With Worksheets("Log Book").ListObjects("TableEntryLog").Font.Size = 10
End With
End Sub
 

Some videos you may like

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
17,409
Office Version
  1. 2013
Platform
  1. Windows
Try this:
VBA Code:
Sub ChangeFontSize()
'Modified  11/24/2020  6:19:26 AM  EST
Dim r As Range

    For Each r In Sheets("Log Book").ListObjects("TableEntryLog").Range
        r.Font.Size = 10
    Next
End Sub

This will change the font size
Not sure what this means
as well as remove any lines in the table
 
Solution

ManUBlueJay

Active Member
Joined
Aug 30, 2012
Messages
250
Office Version
  1. 2016
Platform
  1. Windows
Try this:
VBA Code:
Sub ChangeFontSize()
'Modified  11/24/2020  6:19:26 AM  EST
Dim r As Range

    For Each r In Sheets("Log Book").ListObjects("TableEntryLog").Range
        r.Font.Size = 10
    Next
End Sub

This will change the font size
Not sure what this means
as well as remove any lines in the table
That works.
I also just disvovered this that also works.

VBA Code:
Sub ChangeFontSize()
With Range("TableEntryLog[#All]")
.Font.Size = 10
.Borders.LineStyle = xlNone
End With
End Sub
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
17,409
Office Version
  1. 2013
Platform
  1. Windows
That works.
I also just disvovered this that also works.

VBA Code:
Sub ChangeFontSize()
With Range("TableEntryLog[#All]")
.Font.Size = 10
.Borders.LineStyle = xlNone
End With
End Sub
Glad I was able to help you.
Come back here to Mr. Excel next time you need additional assistance.
 

Watch MrExcel Video

Forum statistics

Threads
1,127,333
Messages
5,624,066
Members
416,010
Latest member
NJT

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
Top