AllExperts > Experts 
Search      

Active X Programming

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More Active X Programming Answers
Question Library

Ask a question about Active X Programming
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
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

 
   

You are here:  Experts > Computing/Technology > Basic > Active X Programming > Microsoft Excel 97 & VB6

Topic: Active X Programming



Expert: Trevor Reid
Date: 1/24/2001
Subject: Microsoft Excel 97 & VB6

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:

Application.DisplayAlerts = False
Sheet1.Delete
Application.DisplayAlerts = True

(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  

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.