Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
Can anybody please help. I have the following scenario and i can't figure the vba out...!!! I have the following columns in 'Sheet1' in cols A, B, C COL A- Planned Date COL B- Re-Planned Date COL C- Actual Date What i am trying to do is get VBA to see if there is a 'planned date' AND a 'Replanned Date', if there is, only use the 'replanned date' and use the following formula i,e,,.... If The re-planned date is blank, automatically enter the following formula into the row (Col D) =IF($C:$C="",0,IF($A:$A=$C:$C,1,-1)) If the re-planned date is NOT blank, automatically enter the formula into the row (Col D) =IF($C:$C="",0,IF($B:$B=$C:$C,1,-1)) I can get the first formula to autofil, using: - Sub FillFormula_startdate() Range("D1").Select ActiveCell.FormulaR1C1 = "=IF(C3=""NA"",0,IF(C1=C3,1,-1))" Dim Rng As Range Set Rng = Range(Cells(1, 1), Cells(Rows.Count, 1).End(xlUp)) Rng.Offset(0, ActiveCell.Column - 1).Formula = Cells(1, ActiveCell.Column).Formula End Sub Any help greatly appreciated..... Many thanks in advance Cheers P :-) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
insert a blank column between each column in a data file | Excel Discussion (Misc queries) | |||
Insert Blank Row Based on Value in Column A | Excel Programming | |||
insert a blank row after data changes in a column | Excel Discussion (Misc queries) | |||
Insert a blank Column Every 9 Columns | Excel Programming | |||
Insert Blank Column every 9 Columns | Excel Programming |