Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Column Width


1) The below macro generates spreadsheets as and when required and works
OK.
The column width of the spreadsheets is 12.75 which is the default
setting.
How can I set the column width to 0.75 from within the macro?

2) How do you set a variable that will be global, I need it to be
recognised in all macros within the same workbook?

Dim ws As Worksheet
Set ws =
ActiveWorkbook.Sheets.Add(after:=ActiveWorkbook.Sh eets(ActiveWorkbook._
Sheets.Count))
ws.Name = "Spreadsheet Name"


--
grahammal
------------------------------------------------------------------------
grahammal's Profile: http://www.excelforum.com/member.php...o&userid=20336
View this thread: http://www.excelforum.com/showthread...hreadid=568241

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Column Width


Hi Graham,

Use ws.Columns.ColumnWidth =0.75

To use a variable as global declare it in the general section of a
module


--
xcelion


------------------------------------------------------------------------
xcelion's Profile: http://www.excelforum.com/member.php...o&userid=16287
View this thread: http://www.excelforum.com/showthread...hreadid=568241

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 138
Default Column Width


"grahammal" wrote
in message ...
How can I set the column width to 0.75 from within the macro?


The macro recorder is your friend. You can easily find the answer to above
and similar questions yourself when you analyze the code produced by the
macro recorder

2) How do you set a variable that will be global, I need it to be
recognised in all macros within the same workbook?


If all your macros are in one module: DIM MyVariable at the beginning of the
module (in the 'General' section, i.e. outside of any SUB procedure)

If your macros are spread among different modules: PUBLIC MyVariable at the
beginning of any module.

Cheers,
Joerg


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
Change Cell Width WITHOUT changing Column width dww701 Excel Discussion (Misc queries) 1 January 12th 09 10:52 PM
How to make cell width different than the column width it lies in John Excel Discussion (Misc queries) 2 September 11th 06 10:41 PM
Set Column Width Based On Total Width Of Other Columns rayneraingoaway Excel Programming 1 June 28th 06 11:10 PM
Change the width of a single column in a column chart Dave Charts and Charting in Excel 2 December 13th 04 07:25 PM


All times are GMT +1. The time now is 11:11 PM.

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"