Worksheet Event Code

  • Thread starter chequer - ExcelForums.com
  • Start date
C

chequer - ExcelForums.com

I want to use a Worksheet Event Code for an IF sub but have no ide
how to create a Worksheet Event Code or how to use ione
Sub would be something like this
Range = C1:C
(C1=1 to C6 =6
If C1 = 1 then Multiply it by 86400 and have the result in rang
B1:B
 
B

Bob Phillips

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("C1:C6")) Is Nothing Then
With Target
If .Value 1 Then
.Offset(0,-1).Value = 86400
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.
 
C

chequer - ExcelForums.com

Sorry I was so long getting back to you. I have no idea about using
Private Sub code. I've been on the sick list for a while and haven'
been well enough to worry about it
Is there a site that I can learn about it.
I'm 76 but I auppose I may have time to learn a bit about it
 

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

Top