What I Want to do is the following:
In the Sheet "Bob"
When I make a change in a cell value in collumn C (say C4)
I would like to insert a row under the active cell (in this case row 4)
and copy the formulas and formating (border and colors)the row where i made the change (in this case row 4) (or I could have a copy of the formulas in row 4, copy that row and insert in the row under 4)... this way Row 5 will be empty
Then I would like C4 to be the active cell
The values of column C is derived and data validated form a list. The point is if I change the value in a cell in column C from blank, to say "Shoe", it inserts a row below and copy the formulas from the "Shoe-row" to the this. If I Change "Shoe" to say "Cat"... the above still should apply. The whole point is to expand an account as I enter values in column C.
All the data (formulas) in the cells are easy If-then statements, like:
=IF(ISERROR(IF(Settings!H7="Nn";0;Oppsett!D8*Account!E14));"";(IF(Settings!H7="No";0;Oppsett!D8*Account!E14)))
The values of column C is derived and data validated form a list. The point is if I change the value in a cell in column C from blank, to say "Shoe", it inserts a row below and copy the formulas from the "Shoe-row" to the this. If I Change "Shoe" to say "Cat"... the above still should apply
I´ve tried this:
___________
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("C:C")) Is Nothing Then
ActiveCell.Offset(1).EntireRow.Insert
Rows(ActiveCell.Row).Select
Sheets("Oppsett").Select
Rows(44).EntireRow.Select
ActiveSheet.Paste
End If
End Sub
_____________
"
I put the row with the data of interest in the worksheet "Oppsett", However, excel freezes up.
I´ve tried this as well:
_____________
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("C:C")) Is Nothing Then
ActiveSheet.Range("a65536").End(xlUp).EntireRow.Copy
ActiveSheet.Range("a65536").End(xlUp).Offset(1, 0).EntireRow.PasteSpecial Paste:=xlPasteFormats
ActiveSheet.Range("a65536").End(xlUp).Offset(1, 0).EntireRow.PasteSpecial Paste:=xlPasteFormulas
Application.CutCopyMode = False
End If
End Sub
________
The vba freezes at the line:
ActiveSheet.Range("a65536").End(xlUp).Offset(1, 0).EntireRow.PasteSpecial Paste:=xlPasteFormulas
By the way
I´ve used this formula to timestamp the entries from the C column eg:
=IF(C14<>"";IF(B14="";TODAY();B14);"") and in the settings set maximum iteration to 1...
Help would be much appreciated!
Regards
Bookmarks