Excel VBA formulas for Spreadsheet by Sharath Kumar Peechara - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

Exercise 22: Column Width function

 

To create this Function, execute the following steps

1. Create a UDF Columnwidth() ( User Defined Function)

  1. Open Excel VBA (Alt + F11)
  2. Insert a New Module
  3. In the Project Explorer, double click on the Module
  4. Add the following code line:

img44.png

This Code lines will create function Columnwidth() In Cell B1 Type

=Columnwidth(A1)

img45.jpg

In Excel Sheet

click on img46.png Home img46.png Cells img46.png Format img46.png Column width to know the size of the Column