Thread: IF file name
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
flow23
 
Posts: n/a
Default IF file name

This is easy but somehow I cant get it

I have a macro that I want to execute only if the workbook has a particualr
file name

so something like
If workbooks.name = " sample.xls" then
' do something
else
' do nothing
end if
end sub

however, what I found was that no matter what the file name, the macro still
goes ahead and get executed