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

Posted incorrect question earier.

Try again




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,339
Default Alignment

Sub Align()

Dim rng As Range, c As Range
'
Set rng = Range("e1:e1000")
For Each c In rng
If c 0 Then
c.Offset(0, -2).HorizontalAlignment = xlRight
Else
c.Offset(0, -2).HorizontalAlignment = xlLeft
End If
Next c
End Sub


HTH

"ED" wrote:

Posted incorrect question earier.

Try again




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 Leah Excel Discussion (Misc queries) 0 November 22nd 05 06:36 PM
Alignment ED Excel Programming 4 June 26th 05 01:45 PM


All times are GMT +1. The time now is 05:54 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"