Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro to merge cell


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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default 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"
wrote in message
news:nshanmugaraj.244u0b_1141454102.8507@excelforu m-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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default 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"
wrote in message
news:nshanmugaraj.244u0b_1141454102.8507@excelforu m-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
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
Merge Macro jlclyde Excel Discussion (Misc queries) 4 January 11th 08 03:43 PM
Macro to Merge and Sum Rows MrGPeter Excel Programming 2 September 15th 05 09:35 AM
macro to merge workbooks Koda Excel Programming 0 July 14th 05 01:41 PM
Need help with merge cells in a macro Armando[_3_] Excel Programming 1 June 15th 04 09:08 PM
Macro to merge cells JA Excel Programming 0 June 3rd 04 03:39 PM


All times are GMT +1. The time now is 01:08 AM.

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"