+ Reply to Thread
Results 1 to 3 of 3

macro to merge cell

  1. #1
    Registered User
    Join Date
    02-15-2006
    Posts
    14

    Question macro to merge cell

    hi

    i need to merge cells on a button click

    pls help

  2. #2
    Nigel
    Guest

    Re: macro to merge cell

    Range("A1:B1").MergeCells = True

    'or... which allows you to reference cells by numerical value (say in a
    loop)

    Range(Cells(1, 1), Cells(1, 2)).MergeCells = True


    Use MergeCells = False to reverse the settings

    --
    Cheers
    Nigel



    "nshanmugaraj" <nshanmugaraj.244u0b_1141454102.8507@excelforum-nospam.com>
    wrote in message
    news:nshanmugaraj.244u0b_1141454102.8507@excelforum-nospam.com...
    >
    > hi
    >
    > i need to merge cells on a button click
    >
    > pls help
    >
    >
    > --
    > nshanmugaraj
    > ------------------------------------------------------------------------
    > nshanmugaraj's Profile:

    http://www.excelforum.com/member.php...o&userid=31570
    > View this thread: http://www.excelforum.com/showthread...hreadid=518943
    >




  3. #3
    Nigel
    Guest

    Re: macro to merge cell

    This may be useful to toggle the range between merge and unmerged using
    control button on the sheet

    Private Sub CommandButton1_Click()
    If CommandButton1.Caption <> "Unmerge" Then
    CommandButton1.Caption = "Unmerge"
    Range("A1:B1").MergeCells = True
    Else
    CommandButton1.Caption = "Merge"
    Range("A1:B1").MergeCells = False
    End If
    End Sub

    --
    Cheers
    Nigel



    "nshanmugaraj" <nshanmugaraj.244u0b_1141454102.8507@excelforum-nospam.com>
    wrote in message
    news:nshanmugaraj.244u0b_1141454102.8507@excelforum-nospam.com...
    >
    > hi
    >
    > i need to merge cells on a button click
    >
    > pls help
    >
    >
    > --
    > nshanmugaraj
    > ------------------------------------------------------------------------
    > nshanmugaraj's Profile:

    http://www.excelforum.com/member.php...o&userid=31570
    > View this thread: http://www.excelforum.com/showthread...hreadid=518943
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1