Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Oct 2008
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts
    In my VBA code, I get an error for the following line with an error "Expected: ="

    If isnumberic(strABOL) Then round(strABOL,2)

    where, strABOL = rng.Offset(0, 1).Value

    What am I doing wrong?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    [quote name='CFDguru' post='763969' date='06-Mar-2009 22:37']In my VBA code, I get an error for the following line with an error "Expected: ="

    If isnumberic(strABOL) Then round(strABOL,2)

    where, strABOL = rng.Offset(0, 1).Value

    What am I doing wrong?[/quote]
    Round is a function, so you must assign its return value to a variable:

    Dim dblVal As Double
    If IsNumeric(strABOL) Then dblVal = Round(strABOL, 2)

    (Please note that it is IsNumeric, not IsNumberic)

  3. #3
    2 Star Lounger
    Join Date
    Oct 2008
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='763971' date='06-Mar-2009 16:41']Round is a function, so you must assign its return value to a variable:

    Dim dblVal As Double
    If IsNumeric(strABOL) Then dblVal = Round(strABOL, 2)

    (Please note that it is IsNumeric, not IsNumberic)[/quote]
    Great. Thanks Hans.

Posting Permissions

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