Thread: Sheet selection
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Sheet selection

Avoid Selections and stay where you a


Sub September_Set()
Dim ws As Worksheet
Set ws = Worksheets("September")
With ws

.Range("D4:F13").Value = ""
.Range("D4:F13").Offset(0, 26).Value = ""


.Range("D15:F25").Value = ""
.Range("D15:F25").Offset(0, 26).Value = ""

End With
End Sub

--
Gary's Student


"Patrick Simonds" wrote:

Is there a way to amend this code so that it does not actually make the
sheet (in this case September) active?

Sub September_Set()

Sheets("September").Select

Range("D4:F13").Select
Selection.Value = ""
Selection.Offset(0, 26).Value = ""

Range("D15:F25").Select
Selection.Value = ""
Selection.Offset(0, 26).Value = ""

Range("A2").Select

End Sub