Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help with marco | Excel Programming | |||
marco help | Excel Programming | |||
Changing Cell Backround from Marco | Excel Programming | |||
Marco | New Users to Excel | |||
marco | Excel Programming |