Thread: Excel Macro
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Excel Macro

Hi,

Try something like this

Sub stantial()
If Range("A1").Value = 1 Then
Path = "C:\"
fname = "Testbook.xls"
Pass = "mypass"
Set mybook = Workbooks.Open(Path & fname, Password:=Pass)
End If
End Sub


Mike

"BobMayers" wrote:

What commads can I use to test a value in a given cell on a worksheet?

I want to open a secondary worksheet based on the number in a cell.

--
BobMayers