Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi..
i need a macro to run when a user open the workbook. should be something like. if sheet1 range a1="a" Application.Run "INVENTRY.xls!newday.newday" if sheet1 range a1="b" Application.Run "INVENTRY.xls!update.update" if sheet1 range a1="c" select sheet1 rangec115 i allready got the 2 macros (update & newday) working but need the workbook to check the condition of range a1 in order to perform the various tasks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Try this Private Sub Workbook_Open() Select Case Sheets("sheet1").Range("A1").Value Case "a" Application.Run "INVENTRY.xls!newday.newday" Case "b" Application.Run "INVENTRY.xls!update.update" Case "c" Sheets("Sheet1").Range("C15").Select End Select End Sub Mike "pswanie" wrote: hi.. i need a macro to run when a user open the workbook. should be something like. if sheet1 range a1="a" Application.Run "INVENTRY.xls!newday.newday" if sheet1 range a1="b" Application.Run "INVENTRY.xls!update.update" if sheet1 range a1="c" select sheet1 rangec115 i allready got the 2 macros (update & newday) working but need the workbook to check the condition of range a1 in order to perform the various tasks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
and this i paste in the
right click on thingie next to file and then view? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to code VBA: Auto open workbook and run macro | Excel Discussion (Misc queries) | |||
auto-open macro lost within workbook | Excel Programming | |||
auto run macro on workbook open | Excel Programming | |||
auto run macro on workbook open | Excel Programming | |||
auto run macro at workbook open | Excel Programming |