Can anybody help me with the alignment in excel (i create an excel file from VB 6.0)
newbook.worksheets(1).range("A1:Z6").Align ????
Thanx
Printable View
Can anybody help me with the alignment in excel (i create an excel file from VB 6.0)
newbook.worksheets(1).range("A1:Z6").Align ????
Thanx
You can use the horizontalalignment and the verticalalignment properties of the range.
newbook.worksheets(1).range("A1:Z6").HorizontalAlignment = xlCenter
Tom Cannaerts
[email protected]
Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
Dim xlSheet as Excel.Worksheet
xlApp.Visible = true
set xlWorkbook = xlApp.Workbooks.Add
set xlSheet = xlWorkbook.Sheets(1)
With xlSheet.Cells(1, 1)
.Value = "Hello"
.HorizontalAlignment = xlCenter ' Center
.HorizontalAlignment = xlRight ' Right Align
.HorizontalAlignment = xlLeft ' Left Align
.VerticalAlignment = xlBottom ' Bottom
.VerticalAlignment = xlCenter ' Center
.VerticalAlignment = xlTop ' Top
End With
xlWorkbook.Close false
xlApp.Quit
Iouri Boutchkine
[email protected]