sheet code help

  • Thread starter Thread starter gareth
  • Start date Start date
G

gareth

I have some Worksheet_Change code that I want to use but
cannot get it to work. I've probably got it all wrong but
a pointer in the right direction would be appreciated:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Count > 1 Then Exit Sub
If Target.Column = 3 Or Target.Column = 6 Or Target.colum
= 9 Or Target.Column = 12 Or Target.colum = 15 Then
On Error GoTo errhandler
Application.EnableEvents = False
'do loads of stuff

End If
errhandler:
Application.EnableEvents = True
End Sub

TIA

Gareth
 
Just a few notes. I don't know if you copied this from the workbook or
rewrote it here, but you have "colum" and not "column" in several spots.

Also, do you want/need any 'else' statement for when your value is not less
than one of 3, 6, 9, 12, 15?
 
Mark

Thanks, hadn't noticed this spelling mistakes, it seems to
working fine now.

Gareth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top