none
How to merge 2 cells in excel from vb? or export data to excel in 2 cells (merged)

    Question

  • Hi..

    please can you help me!

    How to merge 2 cells in excel from vb? or export data to excel in 2 cells (merged)

     oSheet.range("A"+"B" & (1)).value = "American University of Culture and Education"


    • Moved by Mark Liu-lxfModerator Monday, October 17, 2011 5:36 AM vba question (From:Visual Basic General)
    Thursday, October 13, 2011 1:12 PM

Answers

  • On Thu, 13 Oct 2011 13:12:05 +0000, isacnoureddine wrote:
     
    >
    >
    >Hi..
    >
    >please can you help me!
    >
    >How to merge 2 cells in excel from vb? or export data to excel in 2 cells (merged)
    >
    > oSheet.range("A"+"B" & (1)).value = "American University of Culture and Education"
    >
     
    To merge two cells:  range("A1","B1").merge
     
    When you write to a merged range, write to the upper left cell only.  So in the above:
        oSheet.range("A1").value = "American University of Culture and Education"
     
     

    Ron
    Monday, October 17, 2011 11:44 AM

All replies

  • This is the forum for VB in Visual Studio Net,

    Because of how you ask your question I assume you are using VBA.

    Try this forum instead of this

    http://social.msdn.microsoft.com/Forums/en-US/isvvba/threads


    Success
    Cor
    Saturday, October 15, 2011 10:47 AM
  • On Thu, 13 Oct 2011 13:12:05 +0000, isacnoureddine wrote:
     
    >
    >
    >Hi..
    >
    >please can you help me!
    >
    >How to merge 2 cells in excel from vb? or export data to excel in 2 cells (merged)
    >
    > oSheet.range("A"+"B" & (1)).value = "American University of Culture and Education"
    >
     
    To merge two cells:  range("A1","B1").merge
     
    When you write to a merged range, write to the upper left cell only.  So in the above:
        oSheet.range("A1").value = "American University of Culture and Education"
     
     

    Ron
    Monday, October 17, 2011 11:44 AM