#1   Report Post  
Posted to microsoft.public.excel.programming
ED ED is offline
external usenet poster
 
Posts: 8
Default Alignment

Can anyone help?


Code please to align wording in a cell such as:


For c = 1 to 1000
If cell Ec is greater than 0 the wording in cell Cc is aligned right,
other wise wording in cell Cc is aligned left.

Thanks in advance

Ed English
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Alignment

One way:

Dim c As Long
For c = 1 To 1000
Cells(c, 3).HorizontalAlignment = _
IIf(Cells(c, 5).Value 0, xlRight, xlLeft)
Next c



,
ED wrote:

Can anyone help?


Code please to align wording in a cell such as:


For c = 1 to 1000
If cell Ec is greater than 0 the wording in cell Cc is aligned right,
other wise wording in cell Cc is aligned left.

Thanks in advance

Ed English

  #3   Report Post  
Posted to microsoft.public.excel.programming
ED ED is offline
external usenet poster
 
Posts: 8
Default Alignment

Works well.

Thank you,

Ed English


On Mon, 15 Aug 2005 15:50:18 -0600, JE McGimpsey
wrote:

One way:

Dim c As Long
For c = 1 To 1000
Cells(c, 3).HorizontalAlignment = _
IIf(Cells(c, 5).Value 0, xlRight, xlLeft)
Next c



,
ED wrote:

Can anyone help?


Code please to align wording in a cell such as:


For c = 1 to 1000
If cell Ec is greater than 0 the wording in cell Cc is aligned right,
other wise wording in cell Cc is aligned left.

Thanks in advance

Ed English


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
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 ED Excel Programming 1 August 1st 05 04:28 PM
Alignment ED Excel Programming 4 June 26th 05 01:45 PM


All times are GMT +1. The time now is 11:15 AM.

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"