column hiden and check the syntax

VBABEGINER

Well-known Member
Joined
Jun 15, 2011
Messages
1,284
Office Version
  1. 365
Platform
  1. Windows
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

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
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,224,582
Messages
6,179,670
Members
452,936
Latest member
anamikabhargaw

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