Hello folks,
Long time no talk. Hope you're all doing well.
I have a workbook with a few tabs. I want to check first to see if the summary column is already there or not. If it is there, then exit sub or run another sub to create that column. The code is like the following:
Sub FindNCO()
Range(Cells(1, 1), Cells(Cells(1, 1).CurrentRegion.Row, Cells(1, 1).CurrentRegion.Columns.Count)).Select
For Each c In Selection
If InStr(c.Value, "Net Charge Off") Then
Exit Sub
Else:
Exit For
GoTo label
End If
Next
label: Call RunAllTabs
End Sub
But what I have is: if the column is there, the same column will be created again because the 'GoTo label' statements.
Any idea how to fix the bug to get what I want?
Thanks in advance.
Sub RunAllTabs()
For Each st In Worksheets
st.Activate
Call NetChargeOff
ActiveSheet.UsedRange.EntireColumn.AutoFit
Next
End Sub
Long time no talk. Hope you're all doing well.
I have a workbook with a few tabs. I want to check first to see if the summary column is already there or not. If it is there, then exit sub or run another sub to create that column. The code is like the following:
Sub FindNCO()
Range(Cells(1, 1), Cells(Cells(1, 1).CurrentRegion.Row, Cells(1, 1).CurrentRegion.Columns.Count)).Select
For Each c In Selection
If InStr(c.Value, "Net Charge Off") Then
Exit Sub
Else:
Exit For
GoTo label
End If
Next
label: Call RunAllTabs
End Sub
But what I have is: if the column is there, the same column will be created again because the 'GoTo label' statements.
Any idea how to fix the bug to get what I want?
Thanks in advance.
Sub RunAllTabs()
For Each st In Worksheets
st.Activate
Call NetChargeOff
ActiveSheet.UsedRange.EntireColumn.AutoFit
Next
End Sub