Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
briesmith briesmith is offline
external usenet poster
 
Posts: 4
Default Using Macros to Style Multiple Table Rows

I want to apply a styling macro to a selection of rows in a table. I can make
the macro work easily enough but it only does its stuff on the topmost or
first row I have selected.
I want it to format multiple rows (selected using CTRL+RowSelect (right
pointing arrow outside table pointing to desired row)).
It needs to ask itself "have multiple rows been selected?" and if yes, move
down through the table finding all the selected rows and applying the macro
to them as it finds them.
PS I would use the table style tools but they prescribe the rows and cells
you can work on; eg header, last row, top left cell etc. If they included an
option "selected row" or "selected cell" I wouldn't have had to trouble you.
Thank you in advance for any help you can give.
  #2   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Using Macros to Style Multiple Table Rows

You probably need to be applying the formatting to the .Range of the
Selection.

Just what does the macro do?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"briesmith" wrote in message
...
I want to apply a styling macro to a selection of rows in a table. I can
make
the macro work easily enough but it only does its stuff on the topmost or
first row I have selected.
I want it to format multiple rows (selected using CTRL+RowSelect (right
pointing arrow outside table pointing to desired row)).
It needs to ask itself "have multiple rows been selected?" and if yes,
move
down through the table finding all the selected rows and applying the
macro
to them as it finds them.
PS I would use the table style tools but they prescribe the rows and cells
you can work on; eg header, last row, top left cell etc. If they included
an
option "selected row" or "selected cell" I wouldn't have had to trouble
you.
Thank you in advance for any help you can give.



  #3   Report Post  
Posted to microsoft.public.word.tables
briesmith briesmith is offline
external usenet poster
 
Posts: 4
Default Using Macros to Style Multiple Table Rows

Hello Doug

Thanks for troubling to reply. The macro does the following
LineWidth = wdLineWidth050pt
.Color = wdColorAutomatic
End With
.Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone
.Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleNone
.Borders.Shadow = False
End With
With Options
.DefaultBorderLineStyle = wdLineStyleSingle
.DefaultBorderLineWidth = wdLineWidth050pt
.DefaultBorderColor = wdColorAutomatic
End With
Selection.Font.Name = "Arial"
Selection.Font.Size = 8
Selection.Font.Bold = wdToggle
Selection.Font.Color = wdColorWhite
Selection.Font.Color = wdColorWhite
End Sub
Sub TblHdr()
'
' TblHdr Macro
' Macro recorded 6/26/2007 by Brian E Smith
'
With Selection.Cells.Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = wdColorIndigo
End With
With Options
.DefaultBorderLineStyle = wdLineStyleSingle
.DefaultBorderLineWidth = wdLineWidth050pt
.DefaultBorderColor = wdColorAutomatic
End With
Selection.Font.Name = "Arial"
Selection.Font.Size = 8
Selection.Font.Color = wdColorWhite
Selection.Font.Bold = wdToggle
End Sub

I hope this helps.

Brian Smith

"Doug Robbins - Word MVP" wrote:

You probably need to be applying the formatting to the .Range of the
Selection.

Just what does the macro do?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"briesmith" wrote in message
...
I want to apply a styling macro to a selection of rows in a table. I can
make
the macro work easily enough but it only does its stuff on the topmost or
first row I have selected.
I want it to format multiple rows (selected using CTRL+RowSelect (right
pointing arrow outside table pointing to desired row)).
It needs to ask itself "have multiple rows been selected?" and if yes,
move
down through the table finding all the selected rows and applying the
macro
to them as it finds them.
PS I would use the table style tools but they prescribe the rows and cells
you can work on; eg header, last row, top left cell etc. If they included
an
option "selected row" or "selected cell" I wouldn't have had to trouble
you.
Thank you in advance for any help you can give.




  #4   Report Post  
Posted to microsoft.public.word.tables
briesmith briesmith is offline
external usenet poster
 
Posts: 4
Default Using Macros to Style Multiple Table Rows

Hello Doug

I don't know if it's relevant but the selected rows probably won't be
adjacent or contiguous but rather selected at varying intervals down the
table.

Brian

"briesmith" wrote:

Hello Doug

Thanks for troubling to reply. The macro does the following
LineWidth = wdLineWidth050pt
.Color = wdColorAutomatic
End With
.Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone
.Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleNone
.Borders.Shadow = False
End With
With Options
.DefaultBorderLineStyle = wdLineStyleSingle
.DefaultBorderLineWidth = wdLineWidth050pt
.DefaultBorderColor = wdColorAutomatic
End With
Selection.Font.Name = "Arial"
Selection.Font.Size = 8
Selection.Font.Bold = wdToggle
Selection.Font.Color = wdColorWhite
Selection.Font.Color = wdColorWhite
End Sub
Sub TblHdr()
'
' TblHdr Macro
' Macro recorded 6/26/2007 by Brian E Smith
'
With Selection.Cells.Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = wdColorIndigo
End With
With Options
.DefaultBorderLineStyle = wdLineStyleSingle
.DefaultBorderLineWidth = wdLineWidth050pt
.DefaultBorderColor = wdColorAutomatic
End With
Selection.Font.Name = "Arial"
Selection.Font.Size = 8
Selection.Font.Color = wdColorWhite
Selection.Font.Bold = wdToggle
End Sub

I hope this helps.

Brian Smith

"Doug Robbins - Word MVP" wrote:

You probably need to be applying the formatting to the .Range of the
Selection.

Just what does the macro do?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"briesmith" wrote in message
...
I want to apply a styling macro to a selection of rows in a table. I can
make
the macro work easily enough but it only does its stuff on the topmost or
first row I have selected.
I want it to format multiple rows (selected using CTRL+RowSelect (right
pointing arrow outside table pointing to desired row)).
It needs to ask itself "have multiple rows been selected?" and if yes,
move
down through the table finding all the selected rows and applying the
macro
to them as it finds them.
PS I would use the table style tools but they prescribe the rows and cells
you can work on; eg header, last row, top left cell etc. If they included
an
option "selected row" or "selected cell" I wouldn't have had to trouble
you.
Thank you in advance for any help you can give.




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
is there a way to keep multiple table rows together? NU Tables 2 February 15th 07 03:05 PM
Trying to copy multiple rows from a table nutronX Tables 2 March 22nd 06 06:28 PM
table insert multiple rows Mesafalcon Mailmerge 2 January 13th 06 01:56 PM
How do I add multiple rows to a table? Adding rows to tables Tables 3 January 29th 05 08:26 PM
How do you add multiple rows to a table in Word? zeldazombie Tables 1 January 10th 05 04:25 PM


All times are GMT +1. The time now is 02:58 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"