Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.vb.ole.automation
external usenet poster
 
Posts: 5
Default Resize an Excel Column from VB

Hi,


I'm using Office XP and I'm trying to use VB (from Access) to resize a
columns in Excel based on the text (size to fit). How can I do this?


Thanks in advance.

  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.vb.ole.automation
external usenet poster
 
Posts: 162
Default Resize an Excel Column from VB

Dim ws As Excel.Worksheet

Set ws = oXLApp.Worksheets("Your worksheet name")
ws.Columns("A:A").EntireColumn.AutoFit


This assumes that you have some reference to the application, which is
oXLApp in this sample code.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i resize column letters in excel 2007 Debby Excel Worksheet Functions 1 December 10th 09 09:59 PM
how do I resize a range of cells in a column in excel? Terri Excel Discussion (Misc queries) 6 December 20th 06 06:57 PM
how do I resize only a part of a column in excel? Terri Excel Discussion (Misc queries) 1 December 19th 06 09:06 PM
I could NOT resize the axis title but excel allows me to resize gr Iwan Setiyono Ko Charts and Charting in Excel 4 June 6th 06 04:46 AM
I could NOT resize the axis title but excel allows me to resize gr Iwan Setiyono Ko Charts and Charting in Excel 0 March 15th 06 10:34 AM


All times are GMT +1. The time now is 01:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"