+ Reply to Thread
Results 1 to 4 of 4

merging

  1. #1
    Registered User
    Join Date
    02-22-2006
    Posts
    6

    merging

    I want to merge two cells and that new cell to fill with "asdf".
    How could I do that?

  2. #2
    Norman Jones
    Guest

    Re: merging

    Hi M,

    > I want to merge two cells and that new cell to fill with "asdf".
    > How could I do that?


    Avoiding the temptation to respomd "Don't!", because there are all kinds of
    potential problems associated with the use of merged cells, try:

    '=============>>
    Public Sub Tester001()
    Dim rng As Range

    Set rng = Range("A1:B1") '<<==== CHANGE
    With Range("B14:C14")
    .ClearContents
    .Item(1).Value = "asdf"
    .HorizontalAlignment = xlCenter
    .VerticalAlignment = xlBottom
    .WrapText = False
    .Orientation = 0
    .AddIndent = False
    .ShrinkToFit = False
    .MergeCells = True
    End With

    End Sub
    '<<============



    ---
    Regards,
    Norman



    "mpele" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I want to merge two cells and that new cell to fill with "asdf".
    > How could I do that?
    >
    >
    > --
    > mpele
    > ------------------------------------------------------------------------
    > mpele's Profile:
    > http://www.excelforum.com/member.php...o&userid=31808
    > View this thread: http://www.excelforum.com/showthread...hreadid=520454
    >




  3. #3
    Norman Jones
    Guest

    Re: merging

    Hi M,

    > With Range("B14:C14")


    Should read:

    With rng


    ---
    Regards,
    Norman



  4. #4
    NickHK
    Guest

    Re: merging

    mpele,
    Agreeing with Norman to avoid this unless you really have to, you could have
    recorded a macro of the actions and got the answer in all of 10 seconds.
    This is the best to start something that you are not sure of. From there,
    edit the code as necessary, adding variables, error checks, loops etc to
    enhance.

    Nick

    "mpele" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I want to merge two cells and that new cell to fill with "asdf".
    > How could I do that?
    >
    >
    > --
    > mpele
    > ------------------------------------------------------------------------
    > mpele's Profile:

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




+ 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