N
nikolaosk
hi there,
i have a task to check whether a user has align some text in the range
cells from A1:F1.
so there is some text in cell A1.
then the user selects all the cells from A1:f1 and merges them and
then aligns the text center.
that is easy.
i wrote the above sub and thought would work fine but the problem is
that when someone selects the cells a1 to c1 and centers the text in
that range my sub still gives me a correct result
it should not. how can i write a sub that will give me a correct result
only when the user aligns the given text in the range from cells A1:f1
and only in that range?
please help!!
Sub center()
Set app = Application.Workbooks("budget").Worksheets("money")
If app.Range("A1:F1").HorizontalAlignment <> xlCenter Then
MsgBox "error"
Exit Sub
End If
MsgBox ("ok")
End Sub
i have a task to check whether a user has align some text in the range
cells from A1:F1.
so there is some text in cell A1.
then the user selects all the cells from A1:f1 and merges them and
then aligns the text center.
that is easy.
i wrote the above sub and thought would work fine but the problem is
that when someone selects the cells a1 to c1 and centers the text in
that range my sub still gives me a correct result
it should not. how can i write a sub that will give me a correct result
only when the user aligns the given text in the range from cells A1:f1
and only in that range?
please help!!
Sub center()
Set app = Application.Workbooks("budget").Worksheets("money")
If app.Range("A1:F1").HorizontalAlignment <> xlCenter Then
MsgBox "error"
Exit Sub
End If
MsgBox ("ok")
End Sub