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

i have this code entered:

Public Function PayRollSheetFormat()
'Application.Run CleanSheetFormat()
ActiveWindow.FreezePanes = False
Columns("S:S").Select
Selection.ColumnWidth = 10
Columns("T:T").Select
Selection.ColumnWidth = 25
End Function

selecting column S or T selects multiple columns (usually 4: R,S,T,U or
S,T,U,V respectively)

any hints about what might be causing the error?

mark


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default columns seletion error

Hi Mark
some ideas:
- the .select is not required.
- why are you using a function. This won't work as functions can not
change the width of cells - use a sub

try the following
Public Sub PayRollSheetFormat()
'Application.Run CleanSheetFormat()
ActiveWindow.FreezePanes = False
Columns("S").ColumnWidth = 10
Columns("T").ColumnWidth = 25
End Sub

Frank

Try the following:
Public Function PayRollSheetFormat()
'Application.Run CleanSheetFormat()
ActiveWindow.FreezePanes = False
Columns("S:S").Select
Selection.ColumnWidth = 10
Columns("T:T").Select
Selection.ColumnWidth = 25
End Function



mark kubicki wrote:
i have this code entered:

Public Function PayRollSheetFormat()
'Application.Run CleanSheetFormat()
ActiveWindow.FreezePanes = False
Columns("S:S").Select
Selection.ColumnWidth = 10
Columns("T:T").Select
Selection.ColumnWidth = 25
End Function

selecting column S or T selects multiple columns (usually 4: R,S,T,U
or S,T,U,V respectively)

any hints about what might be causing the error?

mark



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
Error Deleting Columns Gk Excel Discussion (Misc queries) 4 August 20th 09 09:44 PM
Text to Columns Error eat more bacon Excel Discussion (Misc queries) 1 June 16th 09 02:28 PM
Grouping columns - error message JRT Excel Worksheet Functions 2 January 21st 09 10:36 AM
Sum up columns in different sheet with error check zeyneddine Excel Discussion (Misc queries) 13 July 10th 06 01:21 PM
Unhiding Columns in Error Big Andy D Excel Discussion (Misc queries) 4 August 4th 05 03:46 PM


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

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

About Us

"It's about Microsoft Excel"