Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2006

Tip: Looking for answers? Try searching our database.

syntax error for counting the number of columns end.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Janis - 20 Sep 2006 00:31 GMT
I had a macro to hide some columns on the end of a report.  They keep
changing the columns on the right so I changed it to automatically count to
the last column and now I get a syntax error.  THANKS!

Public Sub HideXtraColumns()
Dim Rng As Range
' HideCells Macro

With ActiveSheet
'Columns("O:Z").EntireColumn.Hidden = False

Columns(15:(Columns.Count, 1).End(xltoRight)).EntireColumn.Hidden = True
End With
End Sub
Tom Ogilvy - 20 Sep 2006 01:29 GMT
With Activesheet
    .Range(.Cells(1,15), .Cells(1,.Columns.count)   _
          .End(xltoLeft)).EntireColumn.Hidden = True
End With

Signature

Regards,
Tom Ogilvy

>I had a macro to hide some columns on the end of a report.  They keep
> changing the columns on the right so I changed it to automatically count
[quoted text clipped - 11 lines]
> End With
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.