Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Changing Marco

I have a marco that does what I want it to except it messes up some of the
other data on my worksheet. I have two marcos, one for inserting and one for
deleting. They are the following:
Sub InsertSemester()
Dim LastRow As Long
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
v = Rows(LastRow - 1).Formula
Cells(LastRow - 1, "A").Resize(5, 1).EntireRow.Insert
Rows(LastRow - 1) = v
Rows(LastRow + 4).ClearContents
Range("AU2:BG6").Copy Cells(LastRow, "A")
End Sub

Sub DelLastFive()
Dim lr As Long, x As Long
lr = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
x = lr - 4
ActiveSheet.Rows(x & ":" & lr).Delete
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Changing Marco

Sorry this was posted by accident. It can be ignored I have a different post
with the complete question

"JBoyer" wrote:

I have a marco that does what I want it to except it messes up some of the
other data on my worksheet. I have two marcos, one for inserting and one for
deleting. They are the following:
Sub InsertSemester()
Dim LastRow As Long
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
v = Rows(LastRow - 1).Formula
Cells(LastRow - 1, "A").Resize(5, 1).EntireRow.Insert
Rows(LastRow - 1) = v
Rows(LastRow + 4).ClearContents
Range("AU2:BG6").Copy Cells(LastRow, "A")
End Sub

Sub DelLastFive()
Dim lr As Long, x As Long
lr = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
x = lr - 4
ActiveSheet.Rows(x & ":" & lr).Delete
End Sub

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
Help with marco Gary Keramidas Excel Programming 1 December 2nd 06 05:17 AM
marco help mr1104839 Excel Programming 2 August 17th 06 05:42 PM
Changing Cell Backround from Marco davep1553 Excel Programming 1 January 22nd 06 08:27 AM
Marco Loi New Users to Excel 4 December 7th 04 08:52 PM
marco David Kuehl Excel Programming 4 September 18th 03 11:37 PM


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