Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Column widths in Excel


  • Please log in to reply

#1
diggeryo

diggeryo

    Member

  • Member
  • PipPipPip
  • 354 posts
I am using Microsoft Excel 2007. I receive many different documents during the week with a different number of columns in each. But the one thing they have in common is that they each have A LOT of columns. With each file, I need to find out all of its column widths. I've been doing this one column at a time--right clicking on the column header, clicking on "column width," and making a note of the number listed.

But it dawned on me that it might be possible to generate some type of report or something in Excel that will display the width of all columns with data in it. Is there a way to do just that?

thanks,
mike.
  • 0

Advertisements


#2
dsm

dsm

    Member

  • Member
  • PipPip
  • 98 posts
diggeryo,

the following VBA lines should get you started
you could use debug.print or msgbox to display the results


a = Columns("A:A").ColumnWidth
Debug.Print "Column A width = ", a

b = Columns("B:B").ColumnWidth
Debug.Print "Column B width = ", b


regards
DSM
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP