Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code for new row and specific filling down
I have the following piece of code that inserts a new row
in a given position (the active cell row in current worksheet) on each of the 8 listed worksheets below. When the new row is inserted, the code then 'pulls down' formulae from the above row - this is where the problem lies, i only want certain cells to copy down from above, eg where there is a formulae that needs to be copied down, i do not want manual entry cells to copy actual data down from above. How can i specify which specific cells to copy down? OR Is there a method by which i can fill down - as the coding presently does, and then clear the contents of each cell - but leave the formulae present? Many Thanks Lucy Private Sub CommandButton1_Click() Dim wks As Worksheet Dim l_Row As Long Dim rng As Range ActiveCell.Select l_Row = ActiveCell.Row If l_Row = ActiveSheet.Rows.Count Then MsgBox "Can't add any more rows!" Exit Sub ElseIf l_Row = 1 Then MsgBox "Can't fill down from above row 1." Exit Sub End If For Each wks In ThisWorkbook.Worksheets If wks.Name = "Year Summary 02-03" _ Or wks.Name = "Year Summary 03-04" _ Or wks.Name = "Budgeted Hours" _ Or wks.Name = "Associates Hours (actuals)" _ Or wks.Name = "Directors Hours (actuals)" _ Or wks.Name = "Invoices (actuals)" _ Or wks.Name = "Project Costs" _ Or wks.Name = ActiveSheet.Name Then Set rng = wks.Cells(l_Row, 1).EntireRow rng.Insert rng.Offset(-1, 0).FillDown End If Next End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code for new row and specific filling down
Answered elsewhere.
There is no need to multi-post. We all tend to read all the Exce sections -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Filling formulas with specific cell references remaining the same | Excel Worksheet Functions | |||
Filling in cells (or not) based on the entry in a specific collumn | Excel Discussion (Misc queries) | |||
Filling in specific dates in Excel | Excel Discussion (Misc queries) | |||
use VB code IF to automate filling in 11 columns | Excel Discussion (Misc queries) | |||
Excel XP VBA code to search all macro code in Excel module for specific search string criteria | Excel Programming |