Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Rose Howard   on Nov 26 In MS Office Category.

  
Question Answered By: Jet Brown   on Nov 26

I'm using msOffice2003, and have always used
Application.WorkSheetFunction.(insert function here).
Keep in mind that Excel differentiates a workBOOK from a workSHEET.
there are some things that you do with a workBOOK that are not available to a
single workSHEET. For instance, you SAVE a workBOOK, that contains a collection
of SHEETS. At the same time, a workBOOK doesn't have cells, or ranges, or
fonts, or borders (etc.), those belong to a workSHEET.
So, you can't do a horizontal lookup on a workBOOK, you just do it to a
workSHEET....

In SOME cases, Excel will make the proper selection for you.
In your case, if you leave it out, since HLookup only applies to sheets, excel
places that in your code  for you.

In my opinion, I suggest telling Excel what to use instead of letting Excel make
assumptions. It may be that the next revision won't be so kind, and you'll
spend yours debugging code to make it run in the new version...

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on VBA & Hlookup from a newbie Or get search suggestion and latest updates.


Tagged: