Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-11-2013, 07:04 PM
New Daddy New Daddy is offline Can you either (a) float a page of different orientation or (b) rotate table? Windows Vista Can you either (a) float a page of different orientation or (b) rotate table? Office 2003
Advanced Beginner
Can you either (a) float a page of different orientation or (b) rotate table?
 
Join Date: Jan 2012
Posts: 90
New Daddy is on a distinguished road
Question Can you either (a) float a page of different orientation or (b) rotate table?

Here is the situation: I need to insert a large table that will only fit nicely in one page if the page is in the landscape orientation. This creates breakage in my text narrative, because I have to break a section in the middle of a passage. It'd look visually more professional if the text right before the table is flush to the bottom margin of Page x-1, the table appears on page X, and the text picks up again on Page X+1. In order to do this, the whole page in landscape must "float", as a drawing or a frame would float if you anchor it to a certain position in the page.

If this is not possible, can you rotate a table 90 degrees, so that you don't have to start a new section just to create one landscape page? If I can rotate the table 90 degrees counterclockwise, I can frame the entire table and make that frame float.



Can you either (a) float a page of different orientation or (b) rotate a table?
Reply With Quote
  #2  
Old 11-11-2013, 07:37 PM
Charles Kenyon Charles Kenyon is online now Can you either (a) float a page of different orientation or (b) rotate table? Windows 7 64bit Can you either (a) float a page of different orientation or (b) rotate table? Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

You can't have text wrap around a section break which is what you have with a landscape page.

You can have text go in a different direction in a table, though. Tables

Here is an example in Word 2010 with the control that does it on the Ribbon.

Reply With Quote
  #3  
Old 11-11-2013, 08:01 PM
New Daddy New Daddy is offline Can you either (a) float a page of different orientation or (b) rotate table? Windows Vista Can you either (a) float a page of different orientation or (b) rotate table? Office 2003
Advanced Beginner
Can you either (a) float a page of different orientation or (b) rotate table?
 
Join Date: Jan 2012
Posts: 90
New Daddy is on a distinguished road
Default

Quote:
Originally Posted by Charles Kenyon View Post
You can't have text wrap around a section break which is what you have with a landscape page.

You can have text go in a different direction in a table, though. Tables
If there is no other workaround, this might by my best bet.

I've already completed a complex table in the landscape page. Is there an easy way to copy Column 1 to Row 1, Column 2 to Row 2, etc? Otherwise, this will turn into a very laborious copy&paste fest.
Reply With Quote
  #4  
Old 11-11-2013, 08:15 PM
Charles Kenyon Charles Kenyon is online now Can you either (a) float a page of different orientation or (b) rotate table? Windows 7 64bit Can you either (a) float a page of different orientation or (b) rotate table? Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

If the text in your table does not need to be "live" how about putting your table in a separate document, saving it as an image and rotating it in your document.
Reply With Quote
  #5  
Old 11-11-2013, 08:22 PM
New Daddy New Daddy is offline Can you either (a) float a page of different orientation or (b) rotate table? Windows Vista Can you either (a) float a page of different orientation or (b) rotate table? Office 2003
Advanced Beginner
Can you either (a) float a page of different orientation or (b) rotate table?
 
Join Date: Jan 2012
Posts: 90
New Daddy is on a distinguished road
Default

Quote:
Originally Posted by Charles Kenyon View Post
If the text in your table does not need to be "live" how about putting your table in a separate document, saving it as an image and rotating it in your document.
I just gave it a try, and it's barely satisfactory. The resolution is too low, which further gets diminished when I rotate the table imported as an image. Although the table is not "live", I may need to be able to modify it from time to time and it will be a PITA to do the image importing all over again.
Reply With Quote
  #6  
Old 11-12-2013, 11:46 PM
macropod's Avatar
macropod macropod is offline Can you either (a) float a page of different orientation or (b) rotate table? Windows 7 32bit Can you either (a) float a page of different orientation or (b) rotate table? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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 New Daddy View Post
I've already completed a complex table in the landscape page. Is there an easy way to copy Column 1 to Row 1, Column 2 to Row 2, etc? Otherwise, this will turn into a very laborious copy&paste fest.
In Word 2010 and later, provided you have the compatibility mode switched off, you can use: Insert>Text Box>Draw Text Box, insert the table into the text box, then rotate the text box. A good reason to upgrade, perhaps. Conversely, that means the table is no longer in the document body, which can affect other things; it also means the table can't span a page boundary.

The following macro rotates a table, clockwise or counter-clockwise in response to user input, as far as practicable preserving column widths, row heights & text formatting:
Code:
Sub RotateTable()
Application.ScreenUpdating = False
Dim i As Long, j As Long, k As Long, x As Long, y As Long, bRotate As Boolean
Dim RngSrc As Range, RngTgt As Range, TblSrc As Table, TblTgt As Table
With Selection
  If .Information(wdWithInTable) = True Then
  If .Rows.Count > 63 Then
    MsgBox "Too many rows - Word only supports up to 63 columns", vbCritical
    Exit Sub
  End If
  Select Case UCase(Left(InputBox("Do you want to rotate the table:" & vbCr & "R = Right (clockwise); or" & vbCr & "L = Left (counter-clockwise)?"), 1))
    Case "L": bRotate = True
    Case "R": bRotate = False
    Case Else: Exit Sub
  End Select
    Set TblSrc = .Tables(1)
  Else
    MsgBox vbTab & vbTab & "No Table selected!" & vbCr & _
      "Please select some table content before running this macro.", _
       vbCritical, "Selection Error"
    Exit Sub
  End If
End With
With TblSrc
  x = .Rows.Count: y = .Columns.Count
  With .Range
    .Characters.Last.Next.InsertBefore vbCr
    .End = .End + 1
  End With
End With
Set TblTgt = ActiveDocument.Tables.Add(Range:=TblSrc.Range.Characters.Last.Next, NumRows:=y, NumColumns:=x)
With TblTgt
  .Borders = TblSrc.Borders
  If bRotate = True Then
    For i = 1 To x
      For j = 1 To y
        Set RngSrc = TblSrc.Cell(i, j).Range: RngSrc.End = RngSrc.End - 1
        Set RngTgt = .Cell(j, x - i + 1).Range: RngTgt.End = RngTgt.End - 1
        RngTgt.FormattedText = RngSrc.FormattedText
        With .Cell(j, x - i + 1)
          .BottomPadding = TblSrc.Cell(i, j).RightPadding
          .TopPadding = TblSrc.Cell(i, j).LeftPadding
          .RightPadding = TblSrc.Cell(i, j).TopPadding
          .LeftPadding = TblSrc.Cell(i, j).BottomPadding
        End With
      Next
    Next
    On Error Resume Next
    For i = 1 To x
      .Columns(i).Width = TblSrc.Rows(x - i + 1).Height
      If Err.Number = 5149 Then
        .Columns(i).AutoFit
        Err.Clear
      End If
    Next
    For i = 1 To y
      .Rows(i).Height = TblSrc.Columns(i).Width
      If Err.Number = 5149 Then
        .Rows(i).HeightRule = wdRowHeightAuto
        Err.Clear
      End If
    Next
    On Error GoTo 0
    .Range.Orientation = wdTextOrientationDownward
  ElseIf bRotate = False Then
    For i = 1 To x
      For j = 1 To y
        Set RngSrc = TblSrc.Cell(i, y - j + 1).Range: RngSrc.End = RngSrc.End - 1
        Set RngTgt = .Cell(j, i).Range: RngTgt.End = RngTgt.End - 1
        RngTgt.FormattedText = RngSrc.FormattedText
        With .Cell(j, i)
          .BottomPadding = TblSrc.Cell(i, j).LeftPadding
          .TopPadding = TblSrc.Cell(i, j).RightPadding
          .RightPadding = TblSrc.Cell(i, j).BottomPadding
          .LeftPadding = TblSrc.Cell(i, j).TopPadding
        End With
      Next
    Next
    On Error Resume Next
    For i = 1 To x
      .Columns(i).Width = TblSrc.Rows(i).Height
      If Err.Number = 5149 Then
        .Columns(i).AutoFit
        Err.Clear
      End If
    Next
    For i = 1 To y
      .Rows(i).Height = TblSrc.Columns(y - i + 1).Width
      If Err.Number = 5149 Then
        .Rows(i).HeightRule = wdRowHeightAuto
        Err.Clear
      End If
    Next
    On Error GoTo 0
    .Range.Orientation = wdTextOrientationUpward
  End If
End With
TblSrc.Delete
Set RngSrc = Nothing: Set RngTgt = Nothing: Set TblSrc = Nothing: Set TblTgt = Nothing
Application.ScreenUpdating = True
End Sub
Note: The macro does not work with tables containing merged or split cells, and each column must be the same width in all rows. Horizontal starting text is assumed. Ideally, row heights and column widths will be fixed; otherwise they are auto-sized.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 11-13-2013, 07:30 AM
New Daddy New Daddy is offline Can you either (a) float a page of different orientation or (b) rotate table? Windows Vista Can you either (a) float a page of different orientation or (b) rotate table? Office 2003
Advanced Beginner
Can you either (a) float a page of different orientation or (b) rotate table?
 
Join Date: Jan 2012
Posts: 90
New Daddy is on a distinguished road
Default

Thanks for this.

I think one of the rows was not fixed in height, and the macro just froze. Is there any way to stop a macro -- in general, not just this macro in particular -- without aborting Word altogether?
Reply With Quote
  #8  
Old 11-13-2013, 01:07 PM
macropod's Avatar
macropod macropod is offline Can you either (a) float a page of different orientation or (b) rotate table? Windows 7 32bit Can you either (a) float a page of different orientation or (b) rotate table? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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 New Daddy View Post
I think one of the rows was not fixed in height, and the macro just froze.
Code updated to handle rows & columns lacking fixed dimensions.
Quote:
Originally Posted by New Daddy View Post
Is there any way to stop a macro -- in general, not just this macro in particular -- without aborting Word altogether?
Ctrl-Break often does the job.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #9  
Old 11-13-2013, 07:58 PM
New Daddy New Daddy is offline Can you either (a) float a page of different orientation or (b) rotate table? Windows Vista Can you either (a) float a page of different orientation or (b) rotate table? Office 2003
Advanced Beginner
Can you either (a) float a page of different orientation or (b) rotate table?
 
Join Date: Jan 2012
Posts: 90
New Daddy is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Ctrl-Break often does the job.
That works! And to think I shut down Word all these years.

As a companion macro to this one, would it be possible to set the row heights and column widths at the current values as "fixed"? Going through each row and column to fix the values was laborious.
Reply With Quote
  #10  
Old 11-14-2013, 01:55 PM
macropod's Avatar
macropod macropod is offline Can you either (a) float a page of different orientation or (b) rotate table? Windows 7 32bit Can you either (a) float a page of different orientation or (b) rotate table? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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 New Daddy View Post
As a companion macro to this one, would it be possible to set the row heights and column widths at the current values as "fixed"? Going through each row and column to fix the values was laborious.
Not without difficulty and some arbitrariness in the results. What one would have to devise is a means of finding out how high each undefined row is and how wide each undefined column is. For:
• rows, that would presumably entail checking the vertical offset of the first character in each cell on the current row against the vertical offset of the first character in each cell on the next row or, if it's the last row in the table, the next paragraph.
• columns, one would have to compare the relative horizontal offsets of the, say, first character in each cell - ensuring their paragraph formatting had 0 left indent and left/justified alignment.

That's because, if the height or width is not set to an 'exact' or 'at least' value (rows only), retrieving it returns a meaningless 99999. And an 'at least' value can't be turned into a meaningful column width, as columns don't have an 'at least' parameter and the 'at least' value may not be the actual value.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Page Orientation Format Problem dawnwriter Word 3 05-14-2013 11:57 AM
Page borders vs Orientation Ineedcoffee Word 5 12-06-2011 12:52 PM
Can you either (a) float a page of different orientation or (b) rotate table? Rotate Page and Content Within It. walker140 Word 1 11-13-2011 11:08 PM
Can you either (a) float a page of different orientation or (b) rotate table? Changing page orientation within a section el rebelde Word 3 10-11-2011 01:12 AM
Page Orientation bubbelytoes Word 1 09-06-2006 12:41 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:11 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