Newsgroups: microsoft.public.excel.programming
From: Bill-Manvi...@msn.com (Bill Manville)
Date: 1998/03/11
Subject: Re: Inserting new rows with mixed formulas and data w/o copying data
On 11 Mar 1998 21:30:01 GMT, dmcritc...@aol.com (DMcRitchie) wrote: >I would like to insert rows into my spreadsheet and fixup the formulas that ' to remove the non-formulas >might otherwise be destroyed. I do not want to copy cells with data. I only >want to copy the formulas. If it is not a formula leave or make the cell >null. >I am pretty sure that the SOLUTION WILL REQUIRE CHECKING CELLS TO SEE IF >Mark Hill <markh...@charm.net.noSpam> proposed a solution to a problem >Representation of Original Data >25 0 24 =E3+C4-D4 >Mark's Macro: (9 non blank lines) >Sub InsertRowsAndFillFormulas() > If vRows = False Then Exit Sub > Selection.Resize(rowsize:=2).Rows(2).EntireRow.Resize(rowsize:=vRows).Inser t > Selection.AutoFill Selection.Resize(rowsize:=vRows + 1), xlFillDefault Selection.Offset(1).Resize(vRows).EntireRow.SpecialCells(xlConstants).Clear Contents >End Sub If you wrote the formula in E3 as >Results: >This is what I want "--" represents null cells >After inserting lines the results should show inserted cells below non-formulas =OFFSET(E3,-1,0)+C3-D3 and copied it down, you would not need to correct the formula in the row after the inserted rows. Bill Manville You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||