Set range value to int of range value

  • I feel like I have done something similar to this in the past, but now I am starting to think I am remembering wrong.


    Assuming that rng1 and rng2 are identical lengths, is it possible to do something like the following? Output wise I am just getting #VALUE.


    rng1.value = [Int(rng2.value)]

  • Go to Best Answer
  • Hi,


    With Excel ... everything is possible :)


    It depends however on your final objective ...


    You can test your formula as an Array Formula with Control+Shift+Enter instead of the standard Enter key

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • OK ... within a macro... there are several possibilities ....


    Would you mind posting attaching a sample file or, at least posting your macro .... :)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • Apologies as its a big rats nest, let me know if this helps to clarify or not! The line below is what has worked for years, but recently the report I am importing has changed to include the time stamp in the date column I am using, so trying to kill that. This is the line I was hoping to replace with something more elegant like the above, but worst case I am just going to create new formula based columns in the imported report and will copy the INT'd values from there.


    PS this is within a with (With wbOpenBook.Worksheets(1) )


    Sheet2.Range("G" & dToolRow & ":G" & dToolRow + (dExtractRow - 2)).Value = _

    .Range(.Cells(2, rFindRange.Column), .Cells(dExtractRow, rFindRange.Column)).Value

    • Best Answer

    Without interfering with your current process ...


    Hope this will help

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • Gracias!!

    De Nada ... Señor ;)


    Thanks for your Thanks AND for the Like

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!