I have to modify a huge VBA
script, I am new to VBA and I must also say that I am not loving it :(
I need some help writing an efficient For-loop, let me explain with an example.
During the first conversion I want to:
- copy the week cell into all empty cells until it reaches a new week
- copy the person name cell into all empty cells until it reaches a new person
During the second phase I want to:
- remove all rows where the cells C & D & E are empty
I tried the following code to remove rows if column C is empty and it works but I want to remove if column C & D & E are all empty.
On Error Resume Next
'ActiveSheet.Range(Columns(C), Columns(E)).SpecialCells(xlCellTypeBlanks).EntireRow.Delete does not work
ActiveSheet.Columns(C).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
On Error GoTo 0
I would like to do this in place, I mean I want to see the result in place of the original cells.
How can cells be copied based on condition (e.g. copying week X) and how can row be deleted based on condition (e.g. if some cells are empty)?
=A2
inA3
and drag the formula down till next week. do that for both column A and B. Then 3rd step would be to iterate from row 1 to last row and clearContents of entire row when column D,E is empty.