Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    May 2005
    Location
    Wilcox, Saskatchewan
    Posts
    171
    Thanks
    0
    Thanked 0 Times in 0 Posts

    range value in vba, with number format (Excel 2000)

    Hello, I have a problem, I have defined a line in the VB editor in excel:

    iBlenderRate = Worksheets("Sheet1").Range("BlenderRate").Value

    The value in blender rate is 2.5 and iblenderRate sets its self to 2
    is there a way to have the iblenderRate bring in 2.5?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: range value in vba, with number format (Excel 2000)

    Declare iBlenderRate as

    Dim iBlenderRate As Double

    Actually, I would use a different prefix, since i is used for Integer (whole number between -32768 and +32767). I would name the variable dblBlenderRate, where dbl stands for Double. It won't make the code work differently, but it does make it easier to read the code if naming is consistent.

Posting Permissions

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