+ Reply to Thread
Results 1 to 3 of 3

Variable = .cells(x,y).value not working

  1. #1
    Registered User
    Join Date
    04-09-2013
    Location
    Alabama, USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Variable = .cells(x,y).value not working

    I'm trying to assign a variable to the value of a cell using the .cells().value property.

    Dim LIABILITIES as single
    LIABILITIES = worksheets("sheet1").cells(3,18).value
    msgbox LIABILITIES

    The Msgbox that pops up is empty. No value. Cell(3,18) holds a value, $80,000 currently. When I hover the cursor over 'LIABILITIES' in the code, is says 'LIABILITIES = 0'.

    This is killing me. I know that I have the syntax right. I've changed the spreadsheet defaults so that it is R1C1 notation.

    What am I missing?

    Thank you Esteemed Assembly in advance.

    Drake
    Last edited by The Drake; 04-09-2013 at 09:54 AM.

  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: Variable = .cells(x,y).value not working

    What's in R3 on Sheet1?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    04-09-2013
    Location
    Alabama, USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Variable = .cells(x,y).value not working

    Man, do I feel like a fool. I was transposing the rows and columns. /facepalm

+ 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