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 |
All times are GMT +1. The time now is 09:15 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com