Change Font Size in a table

ManUBlueJay

Active Member
Joined
Aug 30, 2012
Messages
302
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
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
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
 
Upvote 0
Solution
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
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,214,965
Messages
6,122,500
Members
449,090
Latest member
RandomExceller01

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