View Full Version : Clearing Data from Specific cols
Howardc
05-15-2013, 07:01 PM
I have a macro to clear data from Row 2 onwards in Col A, Col C to I and Col L to O. However, when activating the macro, the data to the right of Col O is also being cleared, which should not be cleared
Your assistance in resolving this will be most appreciated
747
Rick Rothstein
05-15-2013, 07:58 PM
I have a macro to clear data from Row 2 onwards in Col A, Col C to I and Col L to O. However, when activating the macro, the data to the right of Col O is also being cleared, which should not be cleared
Your assistance in resolving this will be most appreciated
The "data" in Columns P and T that you say are being cleared are actually not being "cleared"... the cells in those columns contain formulas which rely on data being in Column A... the formulas remain, but are set to display the empty text string ("") when the corresponding cell in Column A are blank (which is what your code line is doing). Are you sure you wanted to include Column A in the cells that you are clearing???
Howardc
05-15-2013, 08:17 PM
Hi Rick thanks for getting back to me. The datas in Col a must be cleared
Rick Rothstein
05-15-2013, 08:39 PM
Hi Rick thanks for getting back to me. The datas in Col a must be cleared
Then I am afraid Columns P and T will always look like they are blank (they are not as they still contain formulas) until you put data back in Column A. Just so you understand why, this is the array-entered formula you have in cell T2 (as but one example from that column)...
=IF(A2="","",INDEX(Codes!$C$2:$C$15,MATCH(1,IF(Codes!$A$2:$A$1 5=Fassets!$A2,IF(Codes!$B$2:$B$15=Fassets!$E2,1)), 0)))
The part I highlighted in red is why the cell looks like it was cleared... when you removed the data in A2, this formula displays "" (which looks blank to the human eye). Now, this is the formula you have in cell P2...
=IF(T2="","",""&T2&"=100")
Note the part I highlighted in red for it... because the first formula above makes T2 display "", this formula will end up displaying "" also (again, until some data is put back into Column A). So, your original question is not really a problem since all formulas are doing what they were designed to do.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.