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

In a cell the formula says =if(a10,a2,"nil"). But the
problem is aligning right for numbers and Center for
text. In early versions you could precede with Single
quote or ^ or dbl quote for appropriate alignment.
I'm just a beginner in programming. Another problem is
thelarge number of data so I have to move progressively
from one cell to another with the query. My knowledge of
VBA gets me stuck after:

With Selection
For each Cell

Basically I can only stepover a Macro and make changes.
Is there any other way out without VBA?
Please help.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Alignment problems

Have you tried custom formats.
You can format for individually for +ve ; -ve ; zero
(separated with semicolons).

You could change your formula to if(a10,a2,0). Custom
format for +ve numbers (eg General or whatever), then
after the second semicolon type "nil " with some spaces.
Help Custom formats might give more options for control
of alignment.

Regards,
Paul

-----Original Message-----
In a cell the formula says =if(a10,a2,"nil"). But the
problem is aligning right for numbers and Center for
text. In early versions you could precede with Single
quote or ^ or dbl quote for appropriate alignment.
I'm just a beginner in programming. Another problem is
thelarge number of data so I have to move progressively
from one cell to another with the query. My knowledge of
VBA gets me stuck after:

With Selection
For each Cell

Basically I can only stepover a Macro and make changes.
Is there any other way out without VBA?
Please help.


.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Alignment problems

for each cell in Selection
if application.IsText(cell) then
cell.HorizontalAlignment = xlHAlignLeft
else
cell.HorizontalAlignment = xlHAlignCenter
end if
Next

--
Regards,
Tom Ogilvy

"Shibashis" wrote in message
...
In a cell the formula says =if(a10,a2,"nil"). But the
problem is aligning right for numbers and Center for
text. In early versions you could precede with Single
quote or ^ or dbl quote for appropriate alignment.
I'm just a beginner in programming. Another problem is
thelarge number of data so I have to move progressively
from one cell to another with the query. My knowledge of
VBA gets me stuck after:

With Selection
For each Cell

Basically I can only stepover a Macro and make changes.
Is there any other way out without VBA?
Please help.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Alignment problems

Just a thought:
Custom number formats
a) don't do much for text
b) don't affect alignment

--
Regards,
Tom Ogilvy

"Paul Stevens" wrote in message
...
Have you tried custom formats.
You can format for individually for +ve ; -ve ; zero
(separated with semicolons).

You could change your formula to if(a10,a2,0). Custom
format for +ve numbers (eg General or whatever), then
after the second semicolon type "nil " with some spaces.
Help Custom formats might give more options for control
of alignment.

Regards,
Paul

-----Original Message-----
In a cell the formula says =if(a10,a2,"nil"). But the
problem is aligning right for numbers and Center for
text. In early versions you could precede with Single
quote or ^ or dbl quote for appropriate alignment.
I'm just a beginner in programming. Another problem is
thelarge number of data so I have to move progressively
from one cell to another with the query. My knowledge of
VBA gets me stuck after:

With Selection
For each Cell

Basically I can only stepover a Macro and make changes.
Is there any other way out without VBA?
Please help.


.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Alignment problems

I could have misunderstood the OP's objective, which I was
guessing was simply to display "nil" center aligned in his
formula cell if A1 is <=0 or otherwise A2.

I appreciate custom formats do not change text formatting,
possibly I should have added " of 'nil' which should not
be regarded as text if in a custom format" to the last
sentence of my post. However I think what I proposed
would achieve something close to his objective, if indeed
I correctly understood it.

If so, with a little playing around the OP could display
his "nil", more or less center aligned, with no code and
always updated on calculation.

Regards,
Paul

-----Original Message-----
Just a thought:
Custom number formats
a) don't do much for text
b) don't affect alignment

--
Regards,
Tom Ogilvy

"Paul Stevens"

wrote in message
...
Have you tried custom formats.
You can format for individually for +ve ; -ve ; zero
(separated with semicolons).

You could change your formula to if(a10,a2,0). Custom
format for +ve numbers (eg General or whatever), then
after the second semicolon type "nil " with some

spaces.
Help Custom formats might give more options for

control
of alignment.

Regards,
Paul

-----Original Message-----
In a cell the formula says =if(a10,a2,"nil"). But the
problem is aligning right for numbers and Center for
text. In early versions you could precede with Single
quote or ^ or dbl quote for appropriate alignment.
I'm just a beginner in programming. Another problem is
thelarge number of data so I have to move progressively
from one cell to another with the query. My knowledge

of
VBA gets me stuck after:

With Selection
For each Cell

Basically I can only stepover a Macro and make changes.
Is there any other way out without VBA?
Please help.


.



.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Alignment problems

Didn't intend to cast a negative light on your suggest. I said, "Just a
thought" to indicate this was additional information. You seem to
understand the request just fine. Sorry.

--
Regards,
Tom Ogilvy



"Paul Stevens" wrote in message
...
I could have misunderstood the OP's objective, which I was
guessing was simply to display "nil" center aligned in his
formula cell if A1 is <=0 or otherwise A2.

I appreciate custom formats do not change text formatting,
possibly I should have added " of 'nil' which should not
be regarded as text if in a custom format" to the last
sentence of my post. However I think what I proposed
would achieve something close to his objective, if indeed
I correctly understood it.

If so, with a little playing around the OP could display
his "nil", more or less center aligned, with no code and
always updated on calculation.

Regards,
Paul

-----Original Message-----
Just a thought:
Custom number formats
a) don't do much for text
b) don't affect alignment

--
Regards,
Tom Ogilvy

"Paul Stevens"

wrote in message
...
Have you tried custom formats.
You can format for individually for +ve ; -ve ; zero
(separated with semicolons).

You could change your formula to if(a10,a2,0). Custom
format for +ve numbers (eg General or whatever), then
after the second semicolon type "nil " with some

spaces.
Help Custom formats might give more options for

control
of alignment.

Regards,
Paul

-----Original Message-----
In a cell the formula says =if(a10,a2,"nil"). But the
problem is aligning right for numbers and Center for
text. In early versions you could precede with Single
quote or ^ or dbl quote for appropriate alignment.
I'm just a beginner in programming. Another problem is
thelarge number of data so I have to move progressively
from one cell to another with the query. My knowledge

of
VBA gets me stuck after:

With Selection
For each Cell

Basically I can only stepover a Macro and make changes.
Is there any other way out without VBA?
Please help.


.



.



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Alignment problems

Tom, with all the help I've gleaned from your posts in
this ng (and many thanks) I would only take any comment of
yours as constructive. In this case a little reminder to
be try and be a little more explicit.

As you say, hopefully your "Just a thought" will have
clarified any ambiguity in my earlier post.

Regards,
Paul

-----Original Message-----
Didn't intend to cast a negative light on your suggest.

I said, "Just a
thought" to indicate this was additional information.

You seem to
understand the request just fine. Sorry.

--
Regards,
Tom Ogilvy

Snip

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Alignment problems

In fairness, your suggestion was both original and clever (although with
changeable columns widths and proportional fonts, might be troublesome). I
didn't give it as thorough a read as I might have - so my additional
information, while substantially correct was tangential (you did replace the
text with 0). Your post was clear in what you intended. So, clearly, my
Bad and my apologies.

--
Regards,
Tom Ogilvy


"Paul Stevens" wrote in message
...
Tom, with all the help I've gleaned from your posts in
this ng (and many thanks) I would only take any comment of
yours as constructive. In this case a little reminder to
be try and be a little more explicit.

As you say, hopefully your "Just a thought" will have
clarified any ambiguity in my earlier post.

Regards,
Paul

-----Original Message-----
Didn't intend to cast a negative light on your suggest.

I said, "Just a
thought" to indicate this was additional information.

You seem to
understand the request just fine. Sorry.

--
Regards,
Tom Ogilvy

Snip



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Alignment problems

Thanks for that, boosted my confidence!

When reading other peoples threads I often find exchanges
of this nature useful. Either to get a fuller picture or
better understand what I didn't initially pick up.

So for the body of this ng I would say your comments were
indeed worthwhile, even if this has been a relatively
trivial XL topic.

Regards.
Paul

-----Original Message-----
In fairness, your suggestion was both original and clever

(although with
changeable columns widths and proportional fonts, might

be troublesome). I
didn't give it as thorough a read as I might have - so my

additional
information, while substantially correct was tangential

(you did replace the
text with 0). Your post was clear in what you intended.

So, clearly, my
Bad and my apologies.

--
Regards,
Tom Ogilvy


"Paul Stevens"

wrote in message
...
Tom, with all the help I've gleaned from your posts in
this ng (and many thanks) I would only take any comment

of
yours as constructive. In this case a little reminder to
be try and be a little more explicit.

As you say, hopefully your "Just a thought" will have
clarified any ambiguity in my earlier post.

Regards,
Paul

-----Original Message-----
Didn't intend to cast a negative light on your suggest.

I said, "Just a
thought" to indicate this was additional information.

You seem to
understand the request just fine. Sorry.

--
Regards,
Tom Ogilvy

Snip



.

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
aauugghhh...#div/o problems & various average formula problems acbel40 Excel Worksheet Functions 5 October 19th 09 05:00 PM
In Cell alignment, how do I update the default vertical alignment How to update default cell alignment Setting up and Configuration of Excel 2 February 4th 09 02:25 PM
Right Alignment Paul Gauci New Users to Excel 0 August 18th 08 07:33 PM
Need some help with alignment havocdragon Excel Discussion (Misc queries) 1 August 27th 06 01:09 PM
alignment problems when copying excel graphs to word petevang Excel Discussion (Misc queries) 2 November 23rd 05 09:57 PM


All times are GMT +1. The time now is 07:19 AM.

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

About Us

"It's about Microsoft Excel"