+ Reply to Thread
Results 1 to 4 of 4

Function only working with string variable

  1. #1
    Registered User
    Join Date
    07-27-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Function only working with string variable

    Hi,

    I have created a Function in VBA for looking up a value in a grid it works fine but only if I place the Range as a string and I really need to be able to just select the cells as you would with a standard function.

    Here is my Function

    Please Login or Register  to view this content.
    Vlookup is the Value to find at the Left, Hlookup is the value to find at the top and GArray is the Range to look at.

    Like I say it will work with Glookup(2003,2003,"A1:G10") but I need it to work with Glookup(2003,2003,A1:G10)

    Any help would be great,

    Thanks
    Last edited by Evilbungle; 07-27-2010 at 05:17 AM.

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Function only working with string variable

    Try this:
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    07-27-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Function only working with string variable

    Thanks, That works great.

    Thought I had almost cracked it but clearly i was miles off.

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Function only working with string variable

    There's always more than one way to do something in Excel, so you may have been close - I just choose the path of least resistance generally!

    Please don't forget to mark your question Solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1