Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default Error routine needed

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Error routine needed

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
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
need error loop in pivot table routine Jeff C Excel Discussion (Misc queries) 0 May 29th 08 11:08 AM
Error #1004 routine send emails Gus[_2_] Excel Discussion (Misc queries) 0 June 7th 07 01:23 AM
Print routine needed for code pano Excel Worksheet Functions 3 February 11th 07 02:27 PM
Error Handling Routine kenrmcl Excel Programming 4 April 4th 04 11:50 AM
Help needed with FIND routine. Matthew[_8_] Excel Programming 4 October 5th 03 11:50 PM


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