Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
From an investment portfolio I am trying to exclude a certain asset class (swaps) My idea was to put a simple =IF() statement in column A that identifies if it concerns a plain asset (result=0) or a swap asset (result=1) I defined the below VBA statement but when I run it all formulas (=IF()) are deleted from column A and the results are paste as values. 'Exclude all Swaps Dim iLastRow As Long, iNextRow As Long Dim i As Long With Worksheets("Positions") iLastRow = .Cells(.Rows.Count, "A").End(xlUp).Row For i = 1 To iLastRow Cells(i, "A").Value = "0" iNextRow = iNextRow + 1 .Cells(i, "A").Resize(, 21).Copy _ Worksheets("Cut-Out").Cells(iNextRow, "A") End If Next i End With Can someone tell me what is wrong with this statement and how to adjust it in order not delete the formulas in column A? Many thanks!!!!! Rgds, Robert |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
printing specific lines | Excel Discussion (Misc queries) | |||
Sub to copy only result lines within formula range, omit null string lines | Excel Programming | |||
Copy lines with specific value | Excel Programming | |||
VBA, copy lines with specific value | Excel Programming | |||
Print only lines that have a value in a specific colum | Setting up and Configuration of Excel |