Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default Excel Justify

It is my understanding that Excel will not Justify if the range has equations
in it - True?

Assuming that my previous statement is true I was going to have a helper
column in "A" and have my output in "L" and then put in the following logic
(found after my questions). One item that I discovered was if one line was
completely blank it would not "move the text" up. But if I added a " ", the
justify would work.

Three questions - is there a better way to get around the formula issue?
Are there other known issues (other than a blank line) that I should be on
the look out for? If there is not a better wary to get around the formula
issue - is there better logic than the code below?

Sub test()
shtCB2D.Range("L35:L39").Value = shtCB2D.Range("A35:A39").Value
shtCB2D.Range("L35:U39").Justify
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Excel Justify

Hi,
'Justify' works for me, even on cells containing a formula.
Could you please give an example with Text, Column size and Row size.
--
Regards,
Sébastien
<http://www.ondemandanalysis.com
<http://www.ready-reports.com


"Brad" wrote:

It is my understanding that Excel will not Justify if the range has equations
in it - True?

Assuming that my previous statement is true I was going to have a helper
column in "A" and have my output in "L" and then put in the following logic
(found after my questions). One item that I discovered was if one line was
completely blank it would not "move the text" up. But if I added a " ", the
justify would work.

Three questions - is there a better way to get around the formula issue?
Are there other known issues (other than a blank line) that I should be on
the look out for? If there is not a better wary to get around the formula
issue - is there better logic than the code below?

Sub test()
shtCB2D.Range("L35:L39").Value = shtCB2D.Range("A35:A39").Value
shtCB2D.Range("L35:U39").Justify
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default Excel Justify

Column width of "B" and "C" 8.43
An example - in Cell B2

="Here is the value "&A2&" and the example doesn't work"

Fill - justify B2:C8 gives the error message

"Cannot justify cell containing numbers or formulas."


"sebastienm" wrote:

Hi,
'Justify' works for me, even on cells containing a formula.
Could you please give an example with Text, Column size and Row size.
--
Regards,
Sébastien
<http://www.ondemandanalysis.com
<http://www.ready-reports.com


"Brad" wrote:

It is my understanding that Excel will not Justify if the range has equations
in it - True?

Assuming that my previous statement is true I was going to have a helper
column in "A" and have my output in "L" and then put in the following logic
(found after my questions). One item that I discovered was if one line was
completely blank it would not "move the text" up. But if I added a " ", the
justify would work.

Three questions - is there a better way to get around the formula issue?
Are there other known issues (other than a blank line) that I should be on
the look out for? If there is not a better wary to get around the formula
issue - is there better logic than the code below?

Sub test()
shtCB2D.Range("L35:L39").Value = shtCB2D.Range("A35:A39").Value
shtCB2D.Range("L35:U39").Justify
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Excel Justify

I see, I am getting the same message as you do.
Earlier, I was using a different code, so would that work for you?
shtCB2D.Range("A35:A39").HorizontalAlignment = xlJustify

--
Regards,
Sébastien
<http://www.ondemandanalysis.com
<http://www.ready-reports.com


"Brad" wrote:

Column width of "B" and "C" 8.43
An example - in Cell B2

="Here is the value "&A2&" and the example doesn't work"

Fill - justify B2:C8 gives the error message

"Cannot justify cell containing numbers or formulas."


"sebastienm" wrote:

Hi,
'Justify' works for me, even on cells containing a formula.
Could you please give an example with Text, Column size and Row size.
--
Regards,
Sébastien
<http://www.ondemandanalysis.com
<http://www.ready-reports.com


"Brad" wrote:

It is my understanding that Excel will not Justify if the range has equations
in it - True?

Assuming that my previous statement is true I was going to have a helper
column in "A" and have my output in "L" and then put in the following logic
(found after my questions). One item that I discovered was if one line was
completely blank it would not "move the text" up. But if I added a " ", the
justify would work.

Three questions - is there a better way to get around the formula issue?
Are there other known issues (other than a blank line) that I should be on
the look out for? If there is not a better wary to get around the formula
issue - is there better logic than the code below?

Sub test()
shtCB2D.Range("L35:L39").Value = shtCB2D.Range("A35:A39").Value
shtCB2D.Range("L35:U39").Justify
End Sub

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default Excel Justify

When I put in your code and try to modify it to go across multiple columns -
it just wrapped the text in the first column specified.

"sebastienm" wrote:

I see, I am getting the same message as you do.
Earlier, I was using a different code, so would that work for you?
shtCB2D.Range("A35:A39").HorizontalAlignment = xlJustify

--
Regards,
Sébastien
<http://www.ondemandanalysis.com
<http://www.ready-reports.com


"Brad" wrote:

Column width of "B" and "C" 8.43
An example - in Cell B2

="Here is the value "&A2&" and the example doesn't work"

Fill - justify B2:C8 gives the error message

"Cannot justify cell containing numbers or formulas."


"sebastienm" wrote:

Hi,
'Justify' works for me, even on cells containing a formula.
Could you please give an example with Text, Column size and Row size.
--
Regards,
Sébastien
<http://www.ondemandanalysis.com
<http://www.ready-reports.com


"Brad" wrote:

It is my understanding that Excel will not Justify if the range has equations
in it - True?

Assuming that my previous statement is true I was going to have a helper
column in "A" and have my output in "L" and then put in the following logic
(found after my questions). One item that I discovered was if one line was
completely blank it would not "move the text" up. But if I added a " ", the
justify would work.

Three questions - is there a better way to get around the formula issue?
Are there other known issues (other than a blank line) that I should be on
the look out for? If there is not a better wary to get around the formula
issue - is there better logic than the code below?

Sub test()
shtCB2D.Range("L35:L39").Value = shtCB2D.Range("A35:A39").Value
shtCB2D.Range("L35:U39").Justify
End Sub



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Excel Justify

I have just realized we have a different definition of 'Justify'.

To me Justify is the same as the toolbar icon 'Justify' (similar to Left,
Right, Center alignment; you can get it through ToolbarsCustomize, category
Format Justify) , also the same as in MS Word. 'My' Justify, wraps the text
and aligns both right and left sides by re-arranging the spacing between
characters.

I have just ran your code on a non-formula cell and I see what you mean now.
I had never used/heard of this feature before, sorry.
Interesting though.

I played a bit with Justify and searched around, i couldn't bypass the
formula issue. I couldn't find any method different that your code.
To replace the blank cells by spaces before Justify (but you've probably
already figured that one out though)
shtCB2D.Range("L35:U39").Replace chr(0)," "

--
Regards,
Sébastien
<http://www.ondemandanalysis.com
<http://www.ready-reports.com


"Brad" wrote:

When I put in your code and try to modify it to go across multiple columns -
it just wrapped the text in the first column specified.

"sebastienm" wrote:

I see, I am getting the same message as you do.
Earlier, I was using a different code, so would that work for you?
shtCB2D.Range("A35:A39").HorizontalAlignment = xlJustify

--
Regards,
Sébastien
<http://www.ondemandanalysis.com
<http://www.ready-reports.com


"Brad" wrote:

Column width of "B" and "C" 8.43
An example - in Cell B2

="Here is the value "&A2&" and the example doesn't work"

Fill - justify B2:C8 gives the error message

"Cannot justify cell containing numbers or formulas."


"sebastienm" wrote:

Hi,
'Justify' works for me, even on cells containing a formula.
Could you please give an example with Text, Column size and Row size.
--
Regards,
Sébastien
<http://www.ondemandanalysis.com
<http://www.ready-reports.com


"Brad" wrote:

It is my understanding that Excel will not Justify if the range has equations
in it - True?

Assuming that my previous statement is true I was going to have a helper
column in "A" and have my output in "L" and then put in the following logic
(found after my questions). One item that I discovered was if one line was
completely blank it would not "move the text" up. But if I added a " ", the
justify would work.

Three questions - is there a better way to get around the formula issue?
Are there other known issues (other than a blank line) that I should be on
the look out for? If there is not a better wary to get around the formula
issue - is there better logic than the code below?

Sub test()
shtCB2D.Range("L35:L39").Value = shtCB2D.Range("A35:A39").Value
shtCB2D.Range("L35:U39").Justify
End Sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where is the justify function in Excel 2007? Brandi_G Excel Discussion (Misc queries) 2 June 22nd 09 06:38 PM
How do I use justify across more than 1 cell in Excel 2007 Rick Excel Worksheet Functions 0 June 17th 09 06:33 PM
TOP - Justify and Autofilter the Data in Excel exc08 Excel Programming 0 October 13th 06 07:30 PM
Justify matter in Excel - Ajit 160205 Ajit Munj Excel Discussion (Misc queries) 2 February 17th 05 06:27 AM
Can I right AND left justify to block text in excel? wink53083 Excel Discussion (Misc queries) 2 January 25th 05 08:59 PM


All times are GMT +1. The time now is 11:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"