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: 16
Default Inserting rows at variable points

The macro below allows the user to insert 8 rows on a diary card type form
when needed, using the last blank row on the form. The macro is intended to
be run over and over, however, unless I make the references variable, the
rows will be inserted in the middle of data entry. I don't know how to make
the last row and the inserted rows always occur at the end of the entries. I
can't count the rows to determine the end because I have other entries in
rows below, representing the next page of the form.

Any help is appreciated.

Sub Insertrows1()

ActiveSheet.Unprotect
Range("A23").Select
Selection.End(xlDown).Select
Selection.End(xlDown).Select
Rows("45:45").Select<-------------------- I want this to be one up from
end down, end down, which will be last row of the form.

Selection.Copy
Rows("46:54").Select<---------------------- I want this to be 8 rows
after the last row
Selection.Insert Shift:=xlDown
Range("A46").Select
Selection.End(xlDown).Select
Range("A54").Select<---------- I want to return the user to the last
row, before the insertion of new rows.
ActiveSheet.Protect
End Sub




 
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
inserting specific points on a graph and label them? cj_69 Charts and Charting in Excel 5 December 13th 07 02:15 PM
Inserting Variable Number of Rows bundyloco[_7_] Excel Programming 2 August 29th 05 11:25 AM
variable cell referencing for simple data points pno1 Excel Programming 4 May 19th 05 03:54 PM
Inserting a variable number of rows in a worksheet kls[_2_] Excel Programming 1 August 20th 04 01:47 PM
inserting a variable into VB edb Excel Programming 2 February 29th 04 12:39 PM


All times are GMT +1. The time now is 02:50 PM.

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"