Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi:
I am new to VBA, I have the following code, in the If statement, how can I code it better instead of using lots of "OR". Is there a better way or string comparison. ================================================== ==================== Dim lcCol As String lnColCount = ActiveSheet.UsedRange.Columns.Count 'Column Count For j = 1 To lnColCount lcCol = GetExcelColumn(j) If lcCol = "G" Or lcCol = "H" Or lcCol = "AB" Or lcCol = "AF" Then Columns(lcCol + ":" + lcCol).Select Selection.EntireColumn.Hidden = True End If Next j ================================================== ==================== Thank you Peter |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Syntax problem with code | Excel Discussion (Misc queries) | |||
VBA code to sum a row: syntax needed | Excel Discussion (Misc queries) | |||
Excel VBA Newbies | Excel Programming | |||
help with code/syntax | Excel Programming | |||
not for the newbies... | Excel Programming |