Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-28-2020, 08:04 PM
dana_c_83 dana_c_83 is offline Macro for merging cells in a word table Windows 10 Macro for merging cells in a word table Office 2016
Novice
Macro for merging cells in a word table
 
Join Date: Apr 2020
Posts: 2
dana_c_83 is on a distinguished road
Default Macro for merging cells in a word table

Hi everyone,



I am a writer and deal with huge tables all day every day in Word. I'm new to macros but want a function where I can merge two side-by-side cells together. Does anyone know how I can do this? Will it work if I only want to do that for certain cells?
Reply With Quote
  #2  
Old 04-28-2020, 09:28 PM
macropod's Avatar
macropod macropod is offline Macro for merging cells in a word table Windows 7 64bit Macro for merging cells in a word table Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

That's as simple as seleting the cells to merge, then using:
Code:
Sub Demo()
Selection.Cells.Merge
End Sub
It hardly seems worth the effort, though, as the same functionality is readily available on the Table Tools contextual Ribbon.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 04-29-2020, 03:25 AM
dana_c_83 dana_c_83 is offline Macro for merging cells in a word table Windows 10 Macro for merging cells in a word table Office 2016
Novice
Macro for merging cells in a word table
 
Join Date: Apr 2020
Posts: 2
dana_c_83 is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
That's as simple as seleting the cells to merge, then using:
Code:
Sub Demo()
Selection.Cells.Merge
End Sub
It hardly seems worth the effort, though, as the same functionality is readily available on the Table Tools contextual Ribbon.
Good point, maybe I’m aiming too low given that I’ve never used macros before. When I merge the cells, another issue is that they don’t merge nicely. There’s often an extra space between the two cells. Is there a way to remove this? And is there a way that I can also put the number in the second cell in brackets?
Reply With Quote
  #4  
Old 04-29-2020, 03:04 PM
macropod's Avatar
macropod macropod is offline Macro for merging cells in a word table Windows 7 64bit Macro for merging cells in a word table Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by dana_c_83 View Post
When I merge the cells, another issue is that they don’t merge nicely. There’s often an extra space between the two cells. Is there a way to remove this?
I have no idea what you mean by that. Can you attach a document to a post with some representative data demonstrating the issue? You do this via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.
Quote:
Originally Posted by dana_c_83 View Post
And is there a way that I can also put the number in the second cell in brackets?
There seems to be some scope creep going on here. Please provide the full details of what you're after.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for merging cells in a word table Merging 2 cells riothecat Excel 3 01-04-2017 03:00 PM
Macro for merging cells in a word table Macro to split table cells nachiketapte Word VBA 10 03-08-2016 04:07 AM
Macro to loop through all cells in a table produced by a mail merge elh52 Word VBA 4 08-31-2014 10:50 PM
Macro for merging cells in a word table Macro to Merge Cells Row By Row in a Table KD999 Word VBA 4 02-20-2012 08:51 PM
Merging word files from excel macro hklein Excel Programming 0 08-05-2011 02:27 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:59 PM.


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