Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
syntax error for counting the number of columns end.
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
syntax error for counting the number of columns end.
With Activesheet
.Range(.Cells(1,15), .Cells(1,.Columns.count) _ .End(xltoLeft)).EntireColumn.Hidden = True End With -- Regards, Tom Ogilvy "Janis" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help Counting 10 Columns * X Number of Rows | Excel Worksheet Functions | |||
Counting the number of Error Types | Excel Worksheet Functions | |||
runtime error: syntax error or access violation | Excel Programming | |||
runtime error: syntax error or access violation | Excel Programming | |||
Syntax Error Runtime Error '424' Object Required | Excel Programming |