Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-01-2012, 11:35 PM
ubns ubns is offline Macro to apply style to selected tables Windows 7 32bit Macro to apply style to selected tables Office 2010 32bit
Competent Performer
Macro to apply style to selected tables
 
Join Date: Apr 2012
Posts: 177
ubns is on a distinguished road
Default Macro to apply style to selected tables

Hi,

Has someone got the code that allows you to apply a specifc table style to selected tables only.

Regards



Umesh Banga
Reply With Quote
  #2  
Old 08-02-2012, 04:09 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Macro to apply style to selected tables Windows 7 64bit Macro to apply style to selected tables Office 2010 32bit
Moderator
 
Join Date: Aug 2011
Posts: 3,871
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

Try this:

Code:
 
Sub ApplyTableStyleToSelection()
Dim t As Table
For Each t In Selection.Tables
t.Style = "style name here"
Next t
End Sub
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for tagging and rearranging selected text for revision caotico Word VBA 0 03-28-2012 06:35 PM
Macro to apply style to selected tables Macro Delete Selected Text smonczka Word VBA 2 11-05-2011 03:18 AM
Why Words doesn’t show the style of the selected words automatically???? Jamal NUMAN Word 0 04-14-2011 03:20 PM
Selected text and logo in one macro marijke Word VBA 0 08-24-2009 07:01 AM
Help with a macro to shade a selected pie chart hzrvkt Excel 0 02-24-2006 01:25 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:48 AM.


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