#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default merging


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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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" wrote in
message ...

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default merging

Hi M,

With Range("B14:C14")


Should read:

With rng


---
Regards,
Norman


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default 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" wrote in
message ...

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
help on merging deepika :excel help[_2_] Excel Discussion (Misc queries) 1 February 21st 08 06:17 PM
Merging Sanj Excel Discussion (Misc queries) 5 February 22nd 07 10:40 AM
Merging if henrymartz Excel Worksheet Functions 0 August 16th 06 02:01 AM
When merging information not merging correctly Bridgett Excel Worksheet Functions 0 December 9th 05 10:12 PM
Sorting, Merging, and Re-merging Abi Excel Worksheet Functions 2 June 15th 05 08:21 PM


All times are GMT +1. The time now is 04:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"