How to make the opening a workbook conditional upon the value of cell in another open workbook

M

Marcello do Guzman

I have some VBA code that requires that workbook A must be open before
Workbook B can be opened. If Workbook A is not open then Workbook B
will not open. I would like to add another condition. This condition
would be that the value in cell A1 in Worksheet 1 in Workbook A must
equal a certain value. Does anyone know the VBA code for this? Post
answer in this Usenet group or via email at
(e-mail address removed). Thanks in advance.

Sincerely,


Tommy Toy
 
F

Frank Kabel

Hi
add some lines like the following
dim wbk as workbook
set wbk = workbooks ("worbooka.xls")
if wbk.worksheets("sheet1").range("A1").value <>1 then
´'stop opening'
else
'continue
end if
 

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