|
-
August 31st, 2001, 04:11 AM
#1
Changing cell attributes in excel
Hi,
i am making an excel file from visual basic With the following code:
Dim newbook as Variant
set newbook = X.Workbooks.Add
newbook.worksheets(1).range("A1").Value = "bla"
newbook.worksheets(1).range("A1").Font.Bold = true
This works fine, but there are a few things that i don't know how to do:
Changing column width and row height
changing the cell backcolor
Could anybody help me please?
-
August 31st, 2001, 04:41 AM
#2
Re: Changing cell attributes in excel
'xlsheet here is newbook.worksheets(1) in your code
'xlapp is the variable that istantiate excel.application
'ie:
'private withevents xlApp as Excel.Application
xlSheet.Range("A1").Value = "bla"
xlSheet.Range("A1").Font.Bold = true
xlSheet.Columns("A:A").ColumnWidth = 17.43
xlSheet.Rows("1:1").RowHeight = 15
xlSheet.Range("A3").Select
With xlApp.Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|