Thread: Excel 2003
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Excel 2003

Do you mean
'For Contiguous range
Range("A1:A10").Clear

'For non-contiguous range
Range("A1,B2,C3").Clear

--
Jacob


"Neil Holden" wrote:

Is it possible to clear a range of cells so that it defaults back to template
once the user clicks the button, below is code to attach the excel woorkbook
in an email and once emails i want it to clear certain cells.


Sub Mail_Button66_Click()
'Working in 97-2007
Dim wb As Workbook
Set wb = ActiveWorkbook

If Val(Application.Version) = 12 Then
If wb.FileFormat = 51 And wb.HasVBProject = True Then
MsgBox "There is VBA code in this xlsx file, there will be no
VBA code in the file you send." & vbNewLine & _
"Save the file first as xlsm and then try the macro
again.", vbInformation
Exit Sub
End If
End If

On Error Resume Next
wb.SendMail "", _
"This is the Subject line"
On Error GoTo 0



End Sub