Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filling formulas with specific cell references remaining the same quinxorin Excel Worksheet Functions 2 March 25th 10 06:56 PM
Filling in cells (or not) based on the entry in a specific collumn callmark1 Excel Discussion (Misc queries) 3 January 24th 09 07:38 PM
Filling in specific dates in Excel [email protected] Excel Discussion (Misc queries) 17 November 19th 07 09:13 AM
use VB code IF to automate filling in 11 columns smart.daisy Excel Discussion (Misc queries) 1 May 29th 06 09:08 PM
Excel XP VBA code to search all macro code in Excel module for specific search string criteria Frank Kabel Excel Programming 0 May 19th 04 08:11 PM


All times are GMT +1. The time now is 12:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"