none
i am trying this code to add two value in one cell but it does not work RRS feed

  • Question

  • With xlWorkSheet
               

              .Range("bv:bv").Value =   (textbefore.Text & xlWorkSheet.Range(c & ":" & c).Cells.Value.ToString)
               
               
            End With
    Monday, November 17, 2014 7:39 PM

Answers

  • Hi Minagy,

    What's the target cell you want to set? Range("BV:BV") means the column VB. We can add the row number which we want to set. For example, if we want to set the cell "BV1", we can referer code below:

    Range("BV1").Value="Hello Word!"

    You can get more detail about how to use Range object from link below:

    How Do I... with Cells and Ranges

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, November 18, 2014 8:18 AM
    Moderator

All replies

  • Hello,

    Did you try to debug the code? Do you get any exceptions?

    Anyway, I'd recommend breaking the chain of property and methods calls and declare each property or method call on a separate line of code. Thus, you will be able to find a problematic property or method call which causes the issue.

    Finally, I'd suggest asking Excel specific questions on the Excel for Developers forum instead. VSTO doesn't provide anything for that, nor related to the issue.

    Monday, November 17, 2014 7:57 PM
  • Hi Minagy,

    What's the target cell you want to set? Range("BV:BV") means the column VB. We can add the row number which we want to set. For example, if we want to set the cell "BV1", we can referer code below:

    Range("BV1").Value="Hello Word!"

    You can get more detail about how to use Range object from link below:

    How Do I... with Cells and Ranges

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, November 18, 2014 8:18 AM
    Moderator