View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Curt Curt is offline
external usenet poster
 
Posts: 469
Default not sure on constants

still confused will enclose complete will you tell me if I am going right way
Thank You

Selection.ClearContents
Worksheets("Data").Activate
Range("C4:L100").Select
Worksheets("MailE").Activate
Range("A2:E100").Select
Worksheets("MailD").Activate
Range("A2:F100").Select
Worksheets("Motorcycle").Activate
Range("A2:H60").Select
Worksheets("Indian").Activate
Range("A2:H60").Select
Worksheets("Native").Activate
Range("A2:H60").Select
Worksheets("Donors").Activate
Range("A2:H60").Select
Worksheets("Desc").Activate
Range("A2").Select
Worksheets("Limo Bios").Activate
Range("b3,b5,b7,b9,b11,b13,b15,b17").Select
Worksheets("Balance").Activate
Sub ClearConstants()
Dim rngConstants As Range

On Error Resume Next
Set rngConstants = Range("E3:E30").SpecialCells(xlCellTypeConstants)
On Error GoTo 0

If Not rngConstants Is Nothing Then rngConstants.ClearContents
End Sub
'Range("E3:E30").Select
End Sub


"Jim Thomlinson" wrote:

So you want to clear all of the constants from a given range but leave the
formulas in tact???

Sub ClearConstants()
Dim rngConstants As Range

On Error Resume Next
Set rngConstants = Range("A1:C10").SpecialCells(xlCellTypeConstants)
On Error GoTo 0

If Not rngConstants Is Nothing Then rngConstants.ClearContents
End Sub
--
HTH...

Jim Thomlinson


"Curt" wrote:

this is what I wrote but it will clear formulas would someone inject the
change needed into one place. Then i can see what needs to be done. There is
a lot more to this.
Thanks Much

Selection.ClearContents
Worksheets("Data").Activate
Range("C4:L100").Select
Worksheets("MailE").Activate
Range("A2:E100").Select