Good morning forum,
The macro below intends to find the last used row and clear all the borders
that were not used in the range below it, then move to a new cell and repeat the same process.
The problem is that there might be no data for a day in one of the columns,
because there was No products sold, so we get a error message,
and it will not continue to the next range.
What can I add to the code, so that it can bypass to the next columns
if there is no Data found?
Can some please assist?
Thank you
The macro below intends to find the last used row and clear all the borders
that were not used in the range below it, then move to a new cell and repeat the same process.
The problem is that there might be no data for a day in one of the columns,
because there was No products sold, so we get a error message,
and it will not continue to the next range.
What can I add to the code, so that it can bypass to the next columns
if there is no Data found?
Can some please assist?
Thank you
Code:
Sub Cleann()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.EnableEvents = False
Range("H2").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1:B1").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Clear
ActiveCell.Offset(-11, 3).Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1:B1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Clear
ActiveCell.Offset(-18, 3).Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1:B1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Clear
ActiveCell.Offset(-16, 3).Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1:B1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Clear
ActiveCell.Offset(-15, 3).Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1:B1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
Selection.Clear
ActiveWindow.ScrollColumn = 7
ActiveCell.Offset(-9, -12).Range("A1").Select
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End SubEnd Sub