Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a Excel document I am creating from data in a Access Database.
I have alot of cells that need to be aligned left, right or center. Instead of using the Brute force method of defining an alignment for each individual cell I want to call a Sub Procedure to do the alignment. Here is my Sub I am calling. Public Sub AlignRight( _ Optional ByRef rowStart As Integer, _ Optional ByRef rowEnd As Integer, _ Optional ByRef column As String) Dim x as Integer x = row start For counter = rowStart To rowEnd Range(column & x).HorizontalAlignment = xlRight x = x +1 Next End Sub From my main body of code I call the Sub Procedure with the following line Call AlignRight(20, 29, "A") The code runs just fine but the excel document is not modified. The Code has no problem creating the Excel file, writing the queries from the Access Database to the Excel file and doing all the other formating I have defined in the main body of the code but the Sub Procedure doesn't act on the the Excel file. How do I make the Sub Procedure act on the Excel Spreadsheet? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
In Cell alignment, how do I update the default vertical alignment | Setting up and Configuration of Excel | |||
what does "horizontal alignment = -4108" mean? | Excel Discussion (Misc queries) | |||
Right Alignment | New Users to Excel | |||
Alignment | Excel Programming | |||
Cells(r, c) syntax and horizontal alignment | Excel Programming |