LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 345
Default Cells(r, c) syntax and horizontal alignment

I have a vb macro examining cells in some columns for all rows in a worksheet.
I want to left and right align selected cells based on testing.
The code is working fine to test and move values, and I know the
value "trigger" for the L and R alignment.

I don't know how to "translate" the documentation help example below
into the syntax I'm using to address the cells in the program.
The macro will be run for worksheets that have different names,
but have the same row and column "definitions."

Help? Thanks.

Help example:
Worksheets("Sheet1").Range("A1:A5").HorizontalAlig nment = xlLeft

(or right)
My code's "essence":
Do until cells(row, 4)='9999999' 'end marker
row = row + 1
col = "whatever"

If cells(row, col) "condition" then cells(row, col) = new value

now, If different var test then "right align the above cell"

Loop
--
Neal Z
 
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
Syntax for 'search' in Horizontal range? XL2007 ker_01 Excel Worksheet Functions 2 October 6th 09 04:11 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
what does "horizontal alignment = -4108" mean? Sapna Excel Discussion (Misc queries) 1 January 20th 09 06:45 AM
Format, Cells, Alignment. Highland Cow[_2_] Excel Discussion (Misc queries) 2 August 12th 08 01:05 PM
FORMAT CELLS ALIGNMENT MPJ, the floor-plan-man Excel Discussion (Misc queries) 2 September 29th 05 08:32 PM


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