Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a sales schedule with
Col A Description Col B Date Acquire Col C Date Sold Col D Proceeds Col E Short-term Cost Basis Col F Long-term Cost Basis I just want one column for cost basis, so I inserted a column between E and F and entered a formula: =IF(ISBLANK(E2),G2,E2). I copied the formula down to F20. I did this as a macro. How can I make this flexible if I add rows (more sales)? I've searched the site and have tried things like LastRow and CurrentRegion, but I can't get anyting to work. How do I modify this code to account for added rows? ActiveCell.FormulaR1C1 = "=IF(ISBLANK(RC[-1]),RC[1],RC[-1])" Selection.AutoFill Destination:=Range("F1:F20"), Type:=xlFillDefault Range("F1:F20").Select I'll really appreciate your help. -- Howard |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Linking Sales Order to Sales History Data | Excel Worksheet Functions | |||
Sales Schedule | Excel Discussion (Misc queries) | |||
Sales Invoicing linked to Sales ledger(Accounts Receivable) | Excel Discussion (Misc queries) | |||
show daily sales as a percentage of monthly sales target | Excel Programming |