Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Column width & Row Height changing using macro/vb

I have a worksheet that has and auto_open script to enable Outlining. I need
help on the command that will allow me to change Row and column widths.

Sub auto_open()
With Worksheets("Passive Safety")
.Protect Password:="password", userinterfaceonly:=True
.EnableOutlining = True
End With
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Column width & Row Height changing using macro/vb

This is using the snippets from the VBA help file.
It is pretty simple. You can also use specific
numbers in place of the .RowHeight * 2 Or the
..ColumnWidth * 2.

Sub wdthNhgt()
With Worksheets("Sheet1").Rows(1)
.RowHeight = .RowHeight * 2
End With
With Worksheets("Sheet1").Columns("A")
.ColumnWidth = .ColumnWidth * 2
End With
End Sub

"Ram B" wrote:

I have a worksheet that has and auto_open script to enable Outlining. I need
help on the command that will allow me to change Row and column widths.

Sub auto_open()
With Worksheets("Passive Safety")
.Protect Password:="password", userinterfaceonly:=True
.EnableOutlining = True
End With
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Column width & Row Height changing using macro/vb

JLGWhiz: The code you have works as a stand alone. Also what i am looking for
is to allow the user to dynamically change the height and width on a
protected sheet. I can do this by checking "Format Columns" & "Format Rows"
when I protect the sheet manually Since I have the following in a code

With Worksheets("Passive Safety").Protect Password:="password" in any script.

Once this is executed the manual checks are over ridden. I tried recording a
macro
while protecting which gives me


AllowFormattingColumns:=True
AllowFormattingRows:=True

I tried to incert this but I got an error.

Any suggestions????????


"JLGWhiz" wrote:

This is using the snippets from the VBA help file.
It is pretty simple. You can also use specific
numbers in place of the .RowHeight * 2 Or the
.ColumnWidth * 2.

Sub wdthNhgt()
With Worksheets("Sheet1").Rows(1)
.RowHeight = .RowHeight * 2
End With
With Worksheets("Sheet1").Columns("A")
.ColumnWidth = .ColumnWidth * 2
End With
End Sub

"Ram B" wrote:

I have a worksheet that has and auto_open script to enable Outlining. I need
help on the command that will allow me to change Row and column widths.

Sub auto_open()
With Worksheets("Passive Safety")
.Protect Password:="password", userinterfaceonly:=True
.EnableOutlining = True
End With
End Sub

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
Row height/column width Connie Martin Excel Discussion (Misc queries) 3 June 20th 09 04:12 PM
Column Width and Row Height Workbook Excel Worksheet Functions 4 March 30th 09 06:46 AM
Changing Row Height/Column Width DJ Excel Discussion (Misc queries) 4 February 27th 09 02:07 AM
Changing row height/column width & see the value change while drag DJ Excel Discussion (Misc queries) 0 February 24th 09 04:42 PM
Column Width and Row Height Pillow Excel Worksheet Functions 0 December 13th 05 03:58 PM


All times are GMT +1. The time now is 08:43 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"