Get Activecell alignment
Ivan F Moala
Google
Can Do
Goto Guest book sign in page [Home]
Greatest place to be
Thanks for visiting my site lucky visitor:
This page was last updated on: April 25, 2006
Copyright © 2002. XcelFiles. All Rights Reserved Ivan F Moala
Tell a friend about this page
Option Explicit


Sub GetActiveCellAlignment()
Dim RetVal As Integer, Align As String

'// Note: uses the XL4 macro code
'// How long this will be supported? - don't know
'// works Xl2000
RetVal = Application.ExecuteExcel4Macro("GET.cell(8)")

Select Case RetVal
Case 1: Align = "General"
Case 2: Align = "Left"
Case 3: Align = "Center"
Case 4: Align = "Right"
Case 5: Align = "Fill"
Case 6: Align = "Justified"
Case 7: Align = "Centered across cells"
Case Else: Align = "Unknown"
End Select

'// Tell the user
MsgBox "The active cell aligment is " & Align

End Sub

Get the activecell Alignment info using this code. Just select a cell and run. If you select a range of cells then it will give you the Activecell withing the selection.