LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Insert rows macro


Hi,

In Excel I would like to be able to restrict the places where a use
can insert rows. I have an idea how the macro should work, but I don'
have enough experience to write the code.
The macro should work as follows:

If the activecell is in one of the rows 13:23, 26:30, 32:36, 38:41
43:47, 49, 51:68 then call the macro "InsertCopyRow2" else a messagebo
should appear with the text "You can't insert a row here".
The macro "InsertCopyRow2" is as follows:

Sub InsertCopyRow2()

Application.ScreenUpdating = False
ActiveCell.Offset(1, 0).EntireRow.Insert
ActiveCell.EntireRow.Copy ActiveCell.Offset(1, 0).EntireRow

Selection.Offset(1).EntireRow.SpecialCells(xlConst ants).ClearContents

End Sub

Can someone help me with this problem? Thanks in advance

--
leonida
-----------------------------------------------------------------------
leonidas's Profile: http://www.excelforum.com/member.php...fo&userid=3537
View this thread: http://www.excelforum.com/showthread.php?threadid=55446

 
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
macro to insert rows Flipper Excel Discussion (Misc queries) 1 August 25th 09 04:18 PM
A Macro to Insert Rows Confused_in_Houston[_2_] Excel Discussion (Misc queries) 1 February 2nd 09 05:26 PM
asking again, macro to insert rows Luke Excel Worksheet Functions 12 September 18th 05 06:32 PM
Insert Rows Macro Jason Watts Excel Programming 19 February 5th 04 08:42 PM
macro to insert rows. Todd[_5_] Excel Programming 2 September 27th 03 11:09 PM


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

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

About Us

"It's about Microsoft Excel"