+ Reply to Thread
Results 1 to 6 of 6

1004:runtime error method 'range' of object'_Global failed

  1. #1
    Registered User
    Join Date
    04-20-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    3

    1004:runtime error method 'range' of object'_Global failed

    Hi, I get the above mentioned error in VBA for the code:
    Please Login or Register  to view this content.
    What can be possible wrong with the code/syntax?

    Thanks
    Last edited by Leith Ross; 04-20-2009 at 01:32 AM. Reason: Added Code Tags

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: 1004:runtime error method 'range' of object'_Global failed

    Sorry but it's just wrong.

    Why do you have Application.Match in there? Why the ...?

    What is the code/formula meant to do?

  3. #3
    Registered User
    Join Date
    04-20-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: 1004:runtime error method 'range' of object'_Global failed

    Sorry, the formula was not copied fully...

    Orgid = Application.Index(Range("'Z:\work\[Data.xls]Sheet1'!F:F"), Application.Match(Range(FCode), Range("'Z:\work\[Data.xls]Sheet1'!A:A"), 0))

    I want to get the orgID from workbook "Data" by looking up Fcode available in first column of "Data" workbook. I'll be using this code in a macro.

    Thanks

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: 1004:runtime error method 'range' of object'_Global failed

    Is the workbook Data.xls open?

    What exactly is FCode a named range?

    And finally, what are you actually trying to do?

  5. #5
    Registered User
    Join Date
    04-20-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: 1004:runtime error method 'range' of object'_Global failed

    Hi,

    Is the workbook Data.xls open?
    Yes, the book will be always open.

    What exactly is FCode a named range?
    it is a value genetared during the execution of the program...
    It is not a named range.

    And finally, what are you actually trying to do?
    I want to get the value ORGID from the "Data" excel sheet. I'll be searching for the Fcode in Data workbook in column A and picking the ORGID in that row in column F.

    I'm novice programmer. Do let me know if I have not explained anything properly.

    Thanks!

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: 1004:runtime error method 'range' of object'_Global failed

    But what is FCode? An address for a range?

    Using it like this Range(FCode) means VBA will be regarding it, whatever it is, as a reference to a range.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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