J
Julian Milano
Is there a forum or something dedicated to vbAccelerator controls?
I have a grid placed on an XL VBA userform, and was wondering how would I
set the width of the two columns, equally, upon startup. This is my code so
far:
Private Sub UserForm_Initialize()
With grdTransCalc
.Header = True
.AddColumn vKey:="TOTAL", sHeader:="Total",
ealign:=ecgHdrTextALignCentre
.AddColumn vKey:="AMT", sHeader:="Amount",
ealign:=ecgHdrTextALignCentre
.AutoWidthColumn "TOTAL"
.AutoWidthColumn "AMT"
If .ColumnWidth("TOTAL") < 60 Then .ColumnWidth("TOTAL") = .Width /
2
If .ColumnWidth("AMT") < 60 Then .ColumnWidth("AMT") = .Width / 2
End With
End Sub
The above code doesn't space the columns correctly! Is there a better way?
I have a grid placed on an XL VBA userform, and was wondering how would I
set the width of the two columns, equally, upon startup. This is my code so
far:
Private Sub UserForm_Initialize()
With grdTransCalc
.Header = True
.AddColumn vKey:="TOTAL", sHeader:="Total",
ealign:=ecgHdrTextALignCentre
.AddColumn vKey:="AMT", sHeader:="Amount",
ealign:=ecgHdrTextALignCentre
.AutoWidthColumn "TOTAL"
.AutoWidthColumn "AMT"
If .ColumnWidth("TOTAL") < 60 Then .ColumnWidth("TOTAL") = .Width /
2
If .ColumnWidth("AMT") < 60 Then .ColumnWidth("AMT") = .Width / 2
End With
End Sub
The above code doesn't space the columns correctly! Is there a better way?