Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Initialize HorizontalAlignment from an integer value using VBA
Sub test()
Dim cell As Excel.Range Set cell = Excel.Worksheets("Sheet1").Cells(1, 1) cell.HorizontalAlignment = Val("2") End Sub Int() just converts a number to an integer, if you want to convert a string, you need Val(). Cheers Remy www.collaboral.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I add an integer to an existing integer? | Excel Worksheet Functions | |||
Initialize macro | Excel Programming | |||
HorizontalAlignment Error in Excel 97 | Excel Programming | |||
Cannot set HorizontalAlignment Property of the Range Class | Excel Programming | |||
Setting HorizontalAlignment with VBA | Excel Programming |