![]() |
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 |
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 |
All times are GMT +1. The time now is 11:27 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com