muntasirrahman
asked on
How to format a cell or a Range in Excel From vb6.0
Hi,
I would like to format a cell or Range of Excel from vb6.0 Code,
As the way we could do in
(Excel -> Right click-> Format cells-> Then Number tab->Then Under category List box-> Number)
My sample program is given Below:
Dim objExcel As Excel.Application
Dim objWorkBook As Excel.Workbook
Dim objSheet As Excel.Worksheet
Set objExcel = New Excel.Application
objExcel.Visible = True
Set objWorkBook = objExcel.Workbooks.Add
Set objSheet = objWorkBook.Worksheets(1)
With objSheet
.Cells(1, 3) = CboProject.Text
.Cells(1, 3).Font.Bold = True
.Cells(3, 3) = CboReportFor.Text
.Cells(3, 3).Font.Bold = True
.Cells(4, 3) = "Date From : " & cboUsage_DateFrom & " to " & cboUsage_DateTo
.Cells(4, 3).Font.Bold = True
.cells(X,Y).Format (?)
End With
........................
Can you help me on that?
Thanks in Advance
Muntasir
I would like to format a cell or Range of Excel from vb6.0 Code,
As the way we could do in
(Excel -> Right click-> Format cells-> Then Number tab->Then Under category List box-> Number)
My sample program is given Below:
Dim objExcel As Excel.Application
Dim objWorkBook As Excel.Workbook
Dim objSheet As Excel.Worksheet
Set objExcel = New Excel.Application
objExcel.Visible = True
Set objWorkBook = objExcel.Workbooks.Add
Set objSheet = objWorkBook.Worksheets(1)
With objSheet
.Cells(1, 3) = CboProject.Text
.Cells(1, 3).Font.Bold = True
.Cells(3, 3) = CboReportFor.Text
.Cells(3, 3).Font.Bold = True
.Cells(4, 3) = "Date From : " & cboUsage_DateFrom & " to " & cboUsage_DateTo
.Cells(4, 3).Font.Bold = True
.cells(X,Y).Format (?)
End With
........................
Can you help me on that?
Thanks in Advance
Muntasir
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Record a macro in Excel and you have the exact code you need!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.