A Microsoft Word forum. Microsoft Office Word Forum - WordBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Microsoft Office Word Forum - WordBanter forum » Microsoft Word Newsgroups » Microsoft Word Help
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Merging specific cells via VBA macro



 
 
Thread Tools Display Modes
  #1  
Old May 10th 12, 08:09 PM
Andy Entrekin Andy Entrekin is offline
Junior Member
 
First recorded activity by WordBanter: May 2012
Posts: 2
Default Merging specific cells via VBA macro

I posted the following query in the Tables area, but then saw that most VBA questions were here. Please forgive the double-posting.

I need help with a macro to merge a specified set of cells in a table in a Word 2007 document. My goal is to use code to avoid having to tell hundreds of users which cells to select and merge in a large table, since asking them to do that would inevitably lead to problems. What I've determined so far is that I can't record such a macro, because I can't select the table cells once the macro recorder is active. Once the cells are merged, I want to enter and format text, also using the macro (since it will always say exactly the same thing, to meet regulatory requirements).

As an example, I'd like a macro that will:
Merge the cells from row 32, column 18 through row 38, column 25
Enter the text "Approved Document" in the merged cell and format it as bold and red.

Any and all help will be greatly appreciated.
Ads
  #2  
Old May 11th 12, 09:42 AM
kipster kipster is offline
Junior Member
 
First recorded activity by WordBanter: Apr 2012
Posts: 1
Smile

Quote:
Originally Posted by Andy Entrekin View Post
I posted the following query in the Tables area, but then saw that most VBA questions were here. Please forgive the double-posting.

I need help with a macro to merge a specified set of cells in a table in a Word 2007 document. My goal is to use code to avoid having to tell hundreds of users which cells to select and merge in a large table, since asking them to do that would inevitably lead to problems. What I've determined so far is that I can't record such a macro, because I can't select the table cells once the macro recorder is active. Once the cells are merged, I want to enter and format text, also using the macro (since it will always say exactly the same thing, to meet regulatory requirements).

As an example, I'd like a macro that will:
Merge the cells from row 32, column 18 through row 38, column 25
Enter the text "Approved Document" in the merged cell and format it as bold and red.

Any and all help will be greatly appreciated.
I replied on the other thread
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to hyperlink to a specific page of an PDF file from MS Word 2007 using VBA/VB 6.0 yogeshspsoft Microsoft Word Help 0 March 5th 12 06:31 PM
Print labels in specific cells DanO Mailmerge 1 July 29th 09 05:37 AM
Positioning Data in Indivisual Cells within a Table using VBA Romine Tables 3 August 11th 07 02:02 AM
Tables, Cells, Line Breaks and VBA Nick Marinelli Tables 3 March 28th 06 11:09 PM
Select specific cells in table via macro Bill Sturdevant Microsoft Word Help 1 July 27th 05 03:01 PM


All times are GMT +1. The time now is 07:59 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2004-2013 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.