View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
squenson via OfficeKB.com squenson via OfficeKB.com is offline
external usenet poster
 
Posts: 78
Default auto run macro on open of workbook if cell a1=A

Sub RunWhenOpenDocument()

Select Case Range("Sheet1!A1").Value
Case "a"
Application.Run "INVENTRY.xls!newday.newday"
Case "b"
Application.Run "INVENTRY.xls!update.update"
Case Else
Range("Sheet1!C115").Select
End Select

End Sub

Save this macro in Sheet1, and in ThisWorkbook, under the event Open, insert
the line
Sheet1.RunWhenOpenDocument

Stephane Quenson

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200708/1