View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
PipTT
 
Posts: n/a
Default Excel Macros for Beginners


Q1:

- In the Visual Basic Editor in the project window there's an object
entitled "ThisWorkbook". If you double click this a script window
appears. At the top of the page are two drop down boxes (mine say by
default "(General)" and "(Declarations)").
- Expand the left hand box and click 'Workbook' a private sub will
appear, ignore it and/or delete it later.
- Expand the right hand box. In this there a lots of event. Many
useful ones. The one you want is the 'open' event. Click this and
another sub will appear:

Private Sub Workbook_Open()

End Sub


Q3:
Probably similar to above but use the 'SheetCalculate' or 'SheetChange'
event, then right a macro. Something like:

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
If cells(x,y).value 0 Then
Cells(x,y).select
Selection.copy
Workbooks.open("workbookname")
windows("workbookname").Activate
Cells(x1,y1).select
ActiveSheet.Paste
End If
End Sub


--
PipTT
------------------------------------------------------------------------
PipTT's Profile: http://www.excelforum.com/member.php...o&userid=30989
View this thread: http://www.excelforum.com/showthread...hreadid=506557