Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, I'm trying to create a macro that deletes a line from a spreadsheet i am developing. The code is below, its works fine but I would like to specify rows that the macro will not delete. I need to know the code that specifies either - to end the macro if a specific row is chosen for deletion. Or even better would be the code that specifies that the macro will only delete a line within a specific named range. Application.ScreenUpdating = False ActiveSheet.Unprotect "gpro" varAnswer = MsgBox("Delete Line?", vbOKCancel, "Please Confirm") If varAnswer = 1 Then If Range("D17") = "2" Then ActiveCell.EntireRow.Select Selection.Delete Shift:=xlUp Rows("180:180").Select Selection.EntireRow.Hidden = True Range("E13").Select Else End If Else: End End If ActiveSheet.Protect "gpro", DrawingObjects:=True, Contents:=True, Scenarios:=True End help would be great. Phil |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro data selection line delete | Excel Discussion (Misc queries) | |||
Macro to delete first line of 200+ files | Excel Discussion (Misc queries) | |||
Macro to delete line | Excel Programming | |||
Macro/Function to delete......... | Excel Programming | |||
Help! Excel Macro Delete function!! | Excel Programming |