Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 02-09-2021, 10:33 PM
Wild Bee Wild Bee is offline Macro to change each individual cell to 0 padding, one at a time in a table with merged cells. Windows 10 Macro to change each individual cell to 0 padding, one at a time in a table with merged cells. Office 2019
Novice
Macro to change each individual cell to 0 padding, one at a time in a table with merged cells.
 
Join Date: Feb 2021
Posts: 7
Wild Bee is on a distinguished road
Talking Thankyou!!

You awesome person!! Thank you! The single one worked awesomely. I'll try the other one, but even just the first one is fantastic.

I need to learn how to write VBA..
LOL


Quote:
Originally Posted by gmayor View Post
How about
Code:
Sub Macro1()
Dim oCell As Cell
Dim oTable As Table
    Set oTable = Selection.Tables(1)
    For Each oCell In oTable.Range.Cells
        With oCell
            .TopPadding = InchesToPoints(0)
            .BottomPadding = InchesToPoints(0)
            .LeftPadding = InchesToPoints(0)
            .RightPadding = InchesToPoints(0)
        End With
    Next oCell
End Sub
or for all the tables
Code:
Sub Macro2()
Dim oCell As Cell
Dim oTable As Table
    For Each oTable In ActiveDocument.Tables
        For Each oCell In oTable.Range.Cells
            With oCell
                .TopPadding = InchesToPoints(0)
                .BottomPadding = InchesToPoints(0)
                .LeftPadding = InchesToPoints(0)
                .RightPadding = InchesToPoints(0)
            End With
        Next oCell
        DoEvents
    Next oTable
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to change each individual cell to 0 padding, one at a time in a table with merged cells. Table Row with merged cells andi_bln Word VBA 3 10-15-2020 01:22 AM
How to get autonumber series if adjacent cell has merged cells? kingston123 Excel 3 06-28-2020 09:12 AM
Macro to change each individual cell to 0 padding, one at a time in a table with merged cells. Converting table to text (and back) with carriage returns in cells, split and merged cells ndajko Word 5 11-04-2019 07:53 AM
Merging 2 different cells containing IF formula & change in cell values based on multiple time frame jay_excel Excel 0 07-29-2017 11:04 PM
Macro to change each individual cell to 0 padding, one at a time in a table with merged cells. Table will not allow sorting because "cells are merged". I can't find the merged cells. wendyloooo Word Tables 1 05-26-2015 01:19 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:56 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft