MrExcel Message Board


Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old Mar 30th, 2004, 08:08 PM   #1
APN
 
Join Date: Jun 2003
Location: Ireland
Posts: 93
Default Macro problem..

I am using the following macro...

ActiveSheet.Unprotect Password:="1234"
'Sub InsertRowIF>3()
If Selection.Rows.Count > 1 Then Exit Sub
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:="1234"
If ActiveCell.Row < 4 Then Exit Sub
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:="1234"
ActiveSheet.Unprotect Password:="1234"
ActiveCell.EntireRow.Insert
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:="1234"

End Sub

The problem is I have a rows A & B blank C with TOTALS .D..E..F £.....

A..Blank..B..Blank..C..TOTALS..D..amount $..E..amount $..F..amount $..

I would like to know how to include in the above macro.....to end sub if the row with the above info on it is selected for a row insert....i.e. I do not want a row inserted on selection of row with TOTALS on it as it affects the formulas..

Any help much appreciated....
APN is offline   Reply With Quote
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT +1. The time now is 06:04 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
All contents Copyright 1998-2009 by MrExcel Consulting.