Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Adding or Deleteing Rows in a Range with an Array formula

Hi,
Is it possible to add or delete rows in a range containing an array formula
and maintain the array? I have a couple of routines for I use for worksheets
that do not contain array formulas, but I know they won't work with the array
formula. Here is my current add row / delete row code, can it be modified to
handle the array formulas?

Option Explicit

Private Sub AddRowCA_Click()
Dim rngEntryBottomRow As Range
Application.EnableEvents = False
Application.ScreenUpdating = False
ActiveSheet.Unprotect ("geekk")

Set rngEntryBottomRow = Range("Below_Entry_Bottom_RowCA").Offset(-1)
With rngEntryBottomRow 'rngI
.EntireRow.Insert
.Copy Destination:=.EntireRow.Offset(-1)
.Range("A1,C1:D1").ClearContents
End With

ActiveSheet.Protect ("geekk"), DrawingObjects:=True, Contents:=True,
Scenarios:=True
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub

Private Sub DeleteRowCA_Click()
Dim Response As Integer
Dim rngEntryBottomRow As Range

Set rngEntryBottomRow = Range("Below_Entry_Bottom_RowCA").Offset(-1)

'if last detail row is blank, delete one detail row and If not empty
' then msg box to explain error and exit sub.
If Application.WorksheetFunction.CountA(rngEntryBotto mRow) 7 Then
MsgBox "You are attempting to Delete a Row that contains User
Input." & _
" Delete Row Failed", vbOKOnly + vbCritical, "Can Not Delete" & _
" Row with Information"
If Response = 0 Or 1 Then Exit Sub
End If

If Application.WorksheetFunction.CountA(rngEntryBotto mRow) = 7 Then
Application.EnableEvents = False
Application.ScreenUpdating = False
ActiveSheet.Unprotect ("geekk")
With rngEntryBottomRow
.EntireRow.Delete
End With
End If

ActiveSheet.Protect ("geekk"), DrawingObjects:=True, Contents:=True,
Scenarios:=True
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
--
Casey


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Adding or Deleteing Rows in a Range with an Array formula

Unless you remove the array formula, you can not insert and delete rows

--
Regards,
Tom Ogilvy

"Casey" wrote in message
...
Hi,
Is it possible to add or delete rows in a range containing an array

formula
and maintain the array? I have a couple of routines for I use for

worksheets
that do not contain array formulas, but I know they won't work with the

array
formula. Here is my current add row / delete row code, can it be modified

to
handle the array formulas?

Option Explicit

Private Sub AddRowCA_Click()
Dim rngEntryBottomRow As Range
Application.EnableEvents = False
Application.ScreenUpdating = False
ActiveSheet.Unprotect ("geekk")

Set rngEntryBottomRow =

Range("Below_Entry_Bottom_RowCA").Offset(-1)
With rngEntryBottomRow 'rngI
.EntireRow.Insert
.Copy Destination:=.EntireRow.Offset(-1)
.Range("A1,C1:D1").ClearContents
End With

ActiveSheet.Protect ("geekk"), DrawingObjects:=True, Contents:=True,
Scenarios:=True
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub

Private Sub DeleteRowCA_Click()
Dim Response As Integer
Dim rngEntryBottomRow As Range

Set rngEntryBottomRow = Range("Below_Entry_Bottom_RowCA").Offset(-1)

'if last detail row is blank, delete one detail row and If not empty
' then msg box to explain error and exit sub.
If Application.WorksheetFunction.CountA(rngEntryBotto mRow) 7

Then
MsgBox "You are attempting to Delete a Row that contains User
Input." & _
" Delete Row Failed", vbOKOnly + vbCritical, "Can Not Delete" & _
" Row with Information"
If Response = 0 Or 1 Then Exit Sub
End If

If Application.WorksheetFunction.CountA(rngEntryBotto mRow) = 7

Then
Application.EnableEvents = False
Application.ScreenUpdating = False
ActiveSheet.Unprotect ("geekk")
With rngEntryBottomRow
.EntireRow.Delete
End With
End If

ActiveSheet.Protect ("geekk"), DrawingObjects:=True,

Contents:=True,
Scenarios:=True
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
--
Casey




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Adding or Deleteing Rows in a Range with an Array formula

Thanks Tom appreciate the input.
--
Casey




"Tom Ogilvy" wrote:

Unless you remove the array formula, you can not insert and delete rows

--
Regards,
Tom Ogilvy

"Casey" wrote in message
...
Hi,
Is it possible to add or delete rows in a range containing an array

formula
and maintain the array? I have a couple of routines for I use for

worksheets
that do not contain array formulas, but I know they won't work with the

array
formula. Here is my current add row / delete row code, can it be modified

to
handle the array formulas?

Option Explicit

Private Sub AddRowCA_Click()
Dim rngEntryBottomRow As Range
Application.EnableEvents = False
Application.ScreenUpdating = False
ActiveSheet.Unprotect ("geekk")

Set rngEntryBottomRow =

Range("Below_Entry_Bottom_RowCA").Offset(-1)
With rngEntryBottomRow 'rngI
.EntireRow.Insert
.Copy Destination:=.EntireRow.Offset(-1)
.Range("A1,C1:D1").ClearContents
End With

ActiveSheet.Protect ("geekk"), DrawingObjects:=True, Contents:=True,
Scenarios:=True
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub

Private Sub DeleteRowCA_Click()
Dim Response As Integer
Dim rngEntryBottomRow As Range

Set rngEntryBottomRow = Range("Below_Entry_Bottom_RowCA").Offset(-1)

'if last detail row is blank, delete one detail row and If not empty
' then msg box to explain error and exit sub.
If Application.WorksheetFunction.CountA(rngEntryBotto mRow) 7

Then
MsgBox "You are attempting to Delete a Row that contains User
Input." & _
" Delete Row Failed", vbOKOnly + vbCritical, "Can Not Delete" & _
" Row with Information"
If Response = 0 Or 1 Then Exit Sub
End If

If Application.WorksheetFunction.CountA(rngEntryBotto mRow) = 7

Then
Application.EnableEvents = False
Application.ScreenUpdating = False
ActiveSheet.Unprotect ("geekk")
With rngEntryBottomRow
.EntireRow.Delete
End With
End If

ActiveSheet.Protect ("geekk"), DrawingObjects:=True,

Contents:=True,
Scenarios:=True
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
--
Casey





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
Deleteing some Rows Deepwater Excel Discussion (Misc queries) 1 April 1st 05 06:23 PM
Deleteing Rows Michael Vaughan Excel Programming 2 September 20th 04 09:53 PM
Deleteing Duplicate Rows??? James Excel Programming 13 June 4th 04 03:24 PM
Deleteing Rows Amber[_2_] Excel Programming 3 February 4th 04 06:34 PM
Deleteing Blank Rows Tom Ogilvy Excel Programming 0 August 12th 03 04:29 PM


All times are GMT +1. The time now is 09:58 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"