Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello All,
In my call to the following subroutine, the For Loop is supposed to iterate 51 times. It does this fine when I run it with "step into," but does not work when executed any other way. Sub HideEmptyColumns(wks As Worksheet, lastcolumn As Long, firstrow As Long) 'Hides all empty columns in the wks worksheet between columns 1 and lastcolumn 'if the last non-empty row is firstrow Dim col As Long Dim LastRow As Long ResetUsedRange wks For col = 1 To lastcolumn LastRow = (wks.Cells(Rows.Count, col).End(xlUp).row) If LastRow = firstrow Then Columns(col).Hidden = True End If Next col End Sub Might Excel not be giving the code enough time to execute? If so, how do I give the bit of code more time? I appreciate any help. Thanks, Sisilla |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro code to remove a macro after it executes | Excel Programming | |||
Can I slow the rate that VB executes individual orders? | Excel Programming | |||
SAveAs executes combobox code | Excel Programming | |||
excel executes only a part of a macro | Excel Programming | |||
Count # of Times Sub Executes | Excel Programming |