Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi all, I am not very experienced in writing vba. I have got the following code, put together by recording macros mostly, and editing afterwards. Is there a simpler way to construct the below code. Range("Q2").Select Do While Not IsEmpty(ActiveCell.Offset(0, -1)) ActiveCell.FormulaR1C1 = _ "=IF(OR('Pallet'!RC[-1]<ShipmentDate_StartValue,'Pallet'!RC[-1]ShipmentDate_EndValue),""Del"",""Keep"")" ActiveCell.Offset(1, 0).Select Loop Range("Q2").Select Do While Not IsEmpty(ActiveCell.Offset(0, -1)) Do While ActiveCell = "Del" ActiveCell.Offset(0, -16).Range("A1:Q1").Select Selection.Delete Shift:=xlUp ActiveCell.Offset(0, 16).Select Loop ActiveCell.Offset(1, 0).Select Loop ActiveSheet.Range("Q:Q").ClearContents Data resides in column a to p formula above check the data, populates column q, and acts on it depending on value. Cannot delete the whole row as data is on further columns (unable to change this) Thanks in advance edul |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Tidy up multiple find and replace code | Excel Worksheet Functions | |||
Loop to tidy up my code? | Excel Programming | |||
Can anyone help me tidy up? | Excel Programming | |||
Goto misused: help to tidy Code | Excel Programming | |||
smart & tidy code for many checkBox_Change() | Excel Programming |