column hiden and check the syntax

VBABEGINER

Well-known Member
Joined
Jun 15, 2011
Messages
1,232
Hi,

All Experts,

I am using multiple sheets, i tryed this -
For k = 1 To Worksheets.Count
Worksheets.Item(k).Activate
With ActiveSheet
.Columns("x:ae").EntireColumn.Hidden = True
End With

But still sheets are not hide. currently sheets are hide till col p.
I tryed to extend.
Can this possible.

And the 2 nd problem is the following code is right in syntax.
For i = 8 To p
If (Left(Cells(i, 1), 2)) = "IC" Then
Cells(i, 39) = 1
Else: Cells(i, 39) = 2
End If
Next i
End If
Next k

'Range(Cells(11, 1), Cells(p, 39)).Select

Range("A8:N100").Select

Selection.Sort Key1:=Range("AN11"), Order1:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase _
:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:=xlSortNormal

Here is the problem is that -
insted of sort col A, values in col AN values "2" shown in col A.

I totally unware about the sorting condition.

Can any one, pls!!
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Code:
For k = 1 To Worksheets.Count
   Worksheets(k).Columns("X:AE").EntireColumn.Hidden = True
Next
 
Upvote 0
Hi Wigi,

Thanks for your kind attention.

but 2nd one still pending....i trying some r&d. any i will let u know guys.
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top