IF file name
dim wkbk as workbook
set wkbk = activeworkbook
if trim(lcase(wkbk.name)) = trim(lcase("sample.xls")) then
'do something
else
'do something else
end if
flow23 wrote:
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
--
Dave Peterson
|