Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, everyone !
I have a range with data and formulas from A1:F40 (called "Rng"). My workbook includes a macro (below) which can be initiated by the user, clearing the contents of any given row, but leaving the formulas intact: ActiveCell.EntireRow.SpecialCells(xlCellTypeConsta nts).ClearContents However, I want to include an error routine in my macro which will prevent the user from clearing a row if the active cell is not in "Rng." As usual, your help is greatly appreciated. Thanks, Jeff Wright |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Try this in your routine: Sub Macro1() If ActiveCell.Row <= 40 Then ActiveCell.EntireRow.SpecialCells(xlCellTypeConsta nts).ClearContents End If End Sub Thanks, "Jeff Wright" wrote: Hi, everyone ! I have a range with data and formulas from A1:F40 (called "Rng"). My workbook includes a macro (below) which can be initiated by the user, clearing the contents of any given row, but leaving the formulas intact: ActiveCell.EntireRow.SpecialCells(xlCellTypeConsta nts).ClearContents However, I want to include an error routine in my macro which will prevent the user from clearing a row if the active cell is not in "Rng." As usual, your help is greatly appreciated. Thanks, Jeff Wright |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
need error loop in pivot table routine | Excel Discussion (Misc queries) | |||
Error #1004 routine send emails | Excel Discussion (Misc queries) | |||
Print routine needed for code | Excel Worksheet Functions | |||
Error Handling Routine | Excel Programming | |||
Help needed with FIND routine. | Excel Programming |