PC Review


Reply
Thread Tools Rate Thread

Centering and warping text

 
 
Nils Titley
Guest
Posts: n/a
 
      20th Mar 2008
For my headers on a report I am creating, I need to be able to center
justification and wrap the text. How do I do that in association with this
code or before the code.

ActiveCell.Offset(0, 0).Value = "Date"

Thanks
 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      20th Mar 2008
Worksheets("Sheet1").Range("B2").Value = _
"This text should wrap in a cell."
Worksheets("Sheet1").Range("B2").WrapText = True

Worksheets("Sheet1").Range("B2").HorizontalAlignment = xlCenter

"Nils Titley" wrote:

> For my headers on a report I am creating, I need to be able to center
> justification and wrap the text. How do I do that in association with this
> code or before the code.
>
> ActiveCell.Offset(0, 0).Value = "Date"
>
> Thanks

 
Reply With Quote
 
Nils Titley
Guest
Posts: n/a
 
      20th Mar 2008
I appreciate your suggestion but I am not working with Worksheets or Ranges.
Workbooks and ActiveCell.

Isn't there another way to do what I need to do?

Thanks


"JLGWhiz" wrote:

> Worksheets("Sheet1").Range("B2").Value = _
> "This text should wrap in a cell."
> Worksheets("Sheet1").Range("B2").WrapText = True
>
> Worksheets("Sheet1").Range("B2").HorizontalAlignment = xlCenter
>
> "Nils Titley" wrote:
>
> > For my headers on a report I am creating, I need to be able to center
> > justification and wrap the text. How do I do that in association with this
> > code or before the code.
> >
> > ActiveCell.Offset(0, 0).Value = "Date"
> >
> > Thanks

 
Reply With Quote
 
cht13er
Guest
Posts: n/a
 
      20th Mar 2008
On Mar 20, 2:36*pm, Nils Titley <NilsTit...@discussions.microsoft.com>
wrote:
> I appreciate your suggestion but I am not working with Worksheets or Ranges. *
> Workbooks and ActiveCell.
>
> Isn't there another way to do what I need to do?
>
> Thanks
>
>
>
> "JLGWhiz" wrote:
> > Worksheets("Sheet1").Range("B2").Value = _
> > * * "This text should wrap in a cell."
> > Worksheets("Sheet1").Range("B2").WrapText = True

>
> > Worksheets("Sheet1").Range("B2").HorizontalAlignment = xlCenter

>
> > "Nils Titley" wrote:

>
> > > For my headers on a report I am creating, I need to be able to center
> > > justification and wrap the text. *How do I do that in association with this
> > > code or before the code. * * * *

>
> > > ActiveCell.Offset(0, 0).Value = "Date"

>
> > > Thanks- Hide quoted text -

>
> - Show quoted text -


Isn't the technique the same? Does something like this work?:

Worksheets(ActiveWorkbook).Range(ActiveCell).HorizontalAlignment =
xlCenter


Chris
 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      20th Mar 2008
If you are working in Excel, it is pretty hard to not work with worksheets
and ranges, unless you are doing charts. <g> That said, here is some
different syntax that you might be more comfortable with.

ActiveWorkbook.ActiveCell.HorizontalAlignment = xlCenter
ActiveWorkbook.Selection.WrapText = True

"Nils Titley" wrote:

> I appreciate your suggestion but I am not working with Worksheets or Ranges.
> Workbooks and ActiveCell.
>
> Isn't there another way to do what I need to do?
>
> Thanks
>
>
> "JLGWhiz" wrote:
>
> > Worksheets("Sheet1").Range("B2").Value = _
> > "This text should wrap in a cell."
> > Worksheets("Sheet1").Range("B2").WrapText = True
> >
> > Worksheets("Sheet1").Range("B2").HorizontalAlignment = xlCenter
> >
> > "Nils Titley" wrote:
> >
> > > For my headers on a report I am creating, I need to be able to center
> > > justification and wrap the text. How do I do that in association with this
> > > code or before the code.
> > >
> > > ActiveCell.Offset(0, 0).Value = "Date"
> > >
> > > Thanks

 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      20th Mar 2008
You can also set these attributes manually in Excel on the Format menu. Just
click Format>Alignment then check wrap text and select your alignment in the
drop down box and click OK. You don't need code for this unless you are
building the sheet format entirely through code.

"Nils Titley" wrote:

> I appreciate your suggestion but I am not working with Worksheets or Ranges.
> Workbooks and ActiveCell.
>
> Isn't there another way to do what I need to do?
>
> Thanks
>
>
> "JLGWhiz" wrote:
>
> > Worksheets("Sheet1").Range("B2").Value = _
> > "This text should wrap in a cell."
> > Worksheets("Sheet1").Range("B2").WrapText = True
> >
> > Worksheets("Sheet1").Range("B2").HorizontalAlignment = xlCenter
> >
> > "Nils Titley" wrote:
> >
> > > For my headers on a report I am creating, I need to be able to center
> > > justification and wrap the text. How do I do that in association with this
> > > code or before the code.
> > >
> > > ActiveCell.Offset(0, 0).Value = "Date"
> > >
> > > Thanks

 
Reply With Quote
 
Nils Titley
Guest
Posts: n/a
 
      20th Mar 2008
I am a programmer but I have done mostly C, ADA etc with Simulators. I am
helpinig a friend build a macro to process data so I am learning what I need
to know to do what he needs so I am not up to speed.

What cht13er suggested worked and I will try your suggestion.

Thanks for the help

"JLGWhiz" wrote:

> You can also set these attributes manually in Excel on the Format menu. Just
> click Format>Alignment then check wrap text and select your alignment in the
> drop down box and click OK. You don't need code for this unless you are
> building the sheet format entirely through code.
>
> "Nils Titley" wrote:
>
> > I appreciate your suggestion but I am not working with Worksheets or Ranges.
> > Workbooks and ActiveCell.
> >
> > Isn't there another way to do what I need to do?
> >
> > Thanks
> >
> >
> > "JLGWhiz" wrote:
> >
> > > Worksheets("Sheet1").Range("B2").Value = _
> > > "This text should wrap in a cell."
> > > Worksheets("Sheet1").Range("B2").WrapText = True
> > >
> > > Worksheets("Sheet1").Range("B2").HorizontalAlignment = xlCenter
> > >
> > > "Nils Titley" wrote:
> > >
> > > > For my headers on a report I am creating, I need to be able to center
> > > > justification and wrap the text. How do I do that in association with this
> > > > code or before the code.
> > > >
> > > > ActiveCell.Offset(0, 0).Value = "Date"
> > > >
> > > > Thanks

 
Reply With Quote
 
 
 
Reply

Thread Tools
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
centering text bhc Microsoft Word Document Management 0 16th Feb 2010 11:13 PM
centering text =?Utf-8?B?SmVmZjU1?= Microsoft Word Document Management 2 5th Mar 2007 04:14 PM
Centering Text Laser Microsoft Excel Misc 1 11th Oct 2004 08:56 PM
Re: Centering text Kevin Spencer Microsoft Frontpage 0 3rd Sep 2004 09:11 PM
centering text =?Utf-8?B?RFZQ?= Microsoft Word Document Management 2 10th Nov 2003 11:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:13 PM.