Welcome to the Excel Forum

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.

Please Register to Remove these Ads

Please Register to Remove these Ads



Reply
  #1  
Old 05-12-2009, 03:04 PM
5631 5631 is offline
Registered User
 
Join Date: 31 Mar 2006
MS Office Version:Excel 2003
Posts: 35
5631 is becoming part of the community
Underline a row

Please Register to Remove these Ads

I create a Word document from Access and need some rows to be underlined.
But the width of rows is always different. If a row isn't filled with characters fully it's underlined only where characters are typed. Spaces are not underlined.

So the width of an underlined row is always different.
How can I solve this problem?
Reply With Quote
  #2  
Old 05-13-2009, 09:03 PM
teylyn's Avatar
teylyn teylyn is offline
Forum Moderator
 
Join Date: 28 Oct 2008
Location: German in New Zealand
MS Office Version:2000 - 2010
Posts: 4,510
teylyn makes giving solutions look like childsplay teylyn makes giving solutions look like childsplay teylyn makes giving solutions look like childsplay teylyn makes giving solutions look like childsplay teylyn makes giving solutions look like childsplay teylyn makes giving solutions look like childsplay teylyn makes giving solutions look like childsplay teylyn makes giving solutions look like childsplay teylyn makes giving solutions look like childsplay
Re: Underline a row

Hi,

there's a difference between the underline of text that you can achieve with text formatting and the underline of paragraphs, which will always go to the right hand border of the page.

Text formatting (Format - Font) will only underline the text.

Use Format - Borders and Shading to apply an underline to a paragraph.
__________________
teylyn
If you want to say Thank you to a member, click the reputation icon in the title bar of the post you liked
Everyone needs a pat on the back every once in a while!
...How to Cross-post politely...
Things I do with the right side of my brain ...
Reply With Quote
  #3  
Old 05-14-2009, 02:31 AM
5631 5631 is offline
Registered User
 
Join Date: 31 Mar 2006
MS Office Version:Excel 2003
Posts: 35
5631 is becoming part of the community
Re: Underline a row

Thank you!

That's what I actually do. But the point is borders can be drawn only above or below a paragraph. I need it after definite rows.
That's why I have to split strings and build single paragraphs.
The other problem is that the up border of the following paragraph erases the bottom border of the current paragraph.

I do this all in VBA-code from Access and don't know the number of rows in advance.
It's very inconvenient.
Reply With Quote
  #4  
Old 05-31-2009, 04:47 AM
5631 5631 is offline
Registered User
 
Join Date: 31 Mar 2006
MS Office Version:Excel 2003
Posts: 35
5631 is becoming part of the community
Re: Underline a row

Here is the solution:

Code:
Sub SetTabUntilTheEndOfPage()
  With ActiveDocument.PageSetup
    Selection.ParagraphFormat.TabStops.Add .PageWidth - .LeftMargin - .RightMargin, 0, 3
    Selection.TypeText vbTab
  End With
End Sub
Reply With Quote


Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump