Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Compile Error - Wrong number of arguements or invalid property ass

Created a very basic macro.

Spreadsheet has certain columns hidden and certain ones showing.

I just want the macro to hide all the columns I define (even if they are
already hidden or not)

However when I run it I get an error:

Compile Error - Wrong number of arguements or invalid property assignment.

It highlights the word "COLUMNS" in the debug.


Sub AmendReport()
'This macro unhides all columns and reopens the form for changes
Sheets("Report").Select
Columns("B:AW").Select
Selection.EntireColumn.Hidden = True
End Sub


Any thoughts?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Compile Error - Wrong number of arguements or invalid property ass

James,
I assume this routine is not on the worksheet that you wish to change, but
in a module.
As such, "Columns" cannot be resolved. You would need a "Sheets("Report")."
in front.
Also, unless have a reason, there is no need to "Select". You can achieve
the same with:
Sheets("Report").Columns("B:AW").Hidden = True

NickHK

"James T" wrote in message
...
Created a very basic macro.

Spreadsheet has certain columns hidden and certain ones showing.

I just want the macro to hide all the columns I define (even if they are
already hidden or not)

However when I run it I get an error:

Compile Error - Wrong number of arguements or invalid property assignment.

It highlights the word "COLUMNS" in the debug.


Sub AmendReport()
'This macro unhides all columns and reopens the form for changes
Sheets("Report").Select
Columns("B:AW").Select
Selection.EntireColumn.Hidden = True
End Sub


Any thoughts?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Compile Error - Wrong number of arguements or invalid property ass

Sub AmendReport()

Sheets("Report").Range("B:AW").EntireColumn.Hidden = True

End Sub

"James T" wrote:

Created a very basic macro.

Spreadsheet has certain columns hidden and certain ones showing.

I just want the macro to hide all the columns I define (even if they are
already hidden or not)

However when I run it I get an error:

Compile Error - Wrong number of arguements or invalid property assignment.

It highlights the word "COLUMNS" in the debug.


Sub AmendReport()
'This macro unhides all columns and reopens the form for changes
Sheets("Report").Select
Columns("B:AW").Select
Selection.EntireColumn.Hidden = True
End Sub


Any thoughts?

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
Compile Error: Wrong arguments or Invalid property Brent E Excel Discussion (Misc queries) 3 May 1st 07 07:11 PM
Runtime Error 380 – Could not set the list property. Invalid property value BernzG[_16_] Excel Programming 2 August 21st 05 10:10 PM
compile error: invalid qualifier. MGG Excel Programming 3 August 2nd 05 04:10 PM
Wrong number of Arguments or Invalid property assignment Turin[_2_] Excel Programming 1 July 17th 05 09:52 PM
Runtime error 380: Could not set the List property. invalid property value of listbox jasgrand Excel Programming 0 October 6th 04 09:28 PM


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