View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
dennc01 dennc01 is offline
external usenet poster
 
Posts: 1
Default having a macro work only on a worksheet

I have a simple sub to highlight some cells, is there anyway to make this run on only sheet 1 but not sheet 2 and 3 in a workbook when I press Ctrl+g?

Thanks,

Example

Sub macro1(


' Keyboard Shortcut: Ctrl+

Range("A1:B1").Selec
With Selection.Interio
.ColorIndex =
.Pattern = xlSoli
End Wit
End Sub