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

  • Thread starter Thread starter Marcello do Guzman
  • Start date Start date
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
 
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
 
Back
Top