+ Reply to Thread
Results 1 to 3 of 3

Variable not assigning properly

  1. #1
    Registered User
    Join Date
    11-29-2012
    Location
    Madison, WI
    MS-Off Ver
    MS Office 2010 (Excel, Word, Access)
    Posts
    72

    Variable not assigning properly

    Okay, hopefully this'll turn out to be a quick and easy one. And, in so saying, I'm sure that I've just turned it into a real mess.

    So, I'm trying to set up a check so that my allocation sheet will tell me if I've got rounding errors that will throw me off. And, fortunately, in my sample I do!

    So in my macro, I have the following code:

    Please Login or Register  to view this content.
    My problem pops up on the second line; when I'm assigning the lngAllocTot value, it's pulling a 1, rather than a 1.000001, as I have in my spreadsheet (and in my immediate window, when I check to see if I'm pulling the right cell). And I double checked, I did assign the variable as a Long value, not an Int value.

    Any thoughts?

  2. #2
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Variable not assigning properly

    Long = Long Integer. I think you require a Double.

  3. #3
    Registered User
    Join Date
    11-29-2012
    Location
    Madison, WI
    MS-Off Ver
    MS Office 2010 (Excel, Word, Access)
    Posts
    72

    Re: Variable not assigning properly

    Quote Originally Posted by Izandol View Post
    Long = Long Integer. I think you require a Double.
    Which I just realized 30 seconds ago and dearly hoped I could get here to delete the thread before anybody else saw it.

    I think I'll chalk that one up to not having enough caffeine yet this morning, and go remedy the situation. Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Excel 2007 : assigning into variable
    By lilahh in forum Excel General
    Replies: 7
    Last Post: 08-14-2011, 04:27 AM
  2. Assigning Value to Variable, and Show Value of that Variable
    By torofish in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-19-2010, 05:42 AM
  3. Assigning a variable and pasting variable to last unused column.
    By Ageia in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-20-2008, 05:06 PM
  4. Assigning a min to a variable
    By Ed in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-03-2006, 11:30 AM
  5. Placing a Variable Properly
    By Dennis in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-10-2006, 11:09 AM

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