About Trevor Reid Expertise I enjoy designing AxtiveX controls in VB6. I will answer developers` questions and assist in the development of controls if needed. I am also building a personal library of controls and may have what you need available.
Experience
Past/Present clients Ingram Micro;First Data Corp;First Empire Corp;Zahee.Com;ElectricWisdom.Com
Question I have two questions:
(1) When I delete a worksheet at run-time in my VB code, a prompt asks me whether to confirm this deletion. I would like to bypass this message and directly delete the worksheet.
(2) I would like to format the width, font, and alignment of a column from VB code.
Any information regarding these questions would be most appreciated. Thanks!
Answer (1) You would temporaily turn warning messages off durin the delete routine. For example:
(2) There are a number of approachs to formating in Excel using VBA. Most formatting is accomplished by setting the appropriate properties on a Range object, and there are many differnt ways to get a Range. For examples:
Columns("A:A").ColumnWidth = 21.14
'Changes the width of column A
'Changes the Fill color of Column A
Columns("A:A").Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With