Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default create macro "merge selected cells"?

I want to create macros that relate to selected cells, not absolute or
relative references; specifically, merge and unmerge selected cells. Excel in
Office 2003, Win XP.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default create macro "merge selected cells"?

Maybe this in a module

Sub merge()
response = InputBox(" Merge...(m) or Unmerge...(u)")
Select Case UCase(response)
Case "M"
Selection.MergeCells = True
Case "U"
Selection.MergeCells = False
Case Else
MsgBox "Enter M or U"
End Select
End Sub

Mike

"Mamoudou" wrote:

I want to create macros that relate to selected cells, not absolute or
relative references; specifically, merge and unmerge selected cells. Excel in
Office 2003, Win XP.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default create macro "merge selected cells"?

How about just recording a macro when you do it manually?

Mamoudou wrote:

I want to create macros that relate to selected cells, not absolute or
relative references; specifically, merge and unmerge selected cells. Excel in
Office 2003, Win XP.


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default create macro "merge selected cells"?



"Dave Peterson" wrote:

How about just recording a macro when you do it manually?

Mamoudou wrote:

I want to create macros that relate to selected cells, not absolute or
relative references; specifically, merge and unmerge selected cells. Excel in
Office 2003, Win XP.


--

Dave Peterson
When I do that, the macro records the references of that instance of merging; when I use the macro at a new location, it is still the original cells that get merged. Hence the need for "Merge Selection".

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default create macro "merge selected cells"?

Share your recorded code.

Sometimes, it's a simple change.

Changing a specific range("a1:x1") reference to Selection may work.

Mamoudou wrote:

"Dave Peterson" wrote:

How about just recording a macro when you do it manually?

Mamoudou wrote:

I want to create macros that relate to selected cells, not absolute or
relative references; specifically, merge and unmerge selected cells. Excel in
Office 2003, Win XP.


--

Dave Peterson
When I do that, the macro records the references of that instance of merging; when I use the macro at a new location, it is still the original cells that get merged. Hence the need for "Merge Selection".


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default create macro "merge selected cells"?

Thanx for your interest. I have never used code, only recorded the
keystrokes. I should try that, as in the post above. Why is there no keyboard
shortcut?

"Dave Peterson" wrote:

Share your recorded code.

Sometimes, it's a simple change.

Changing a specific range("a1:x1") reference to Selection may work.

Mamoudou wrote:

"Dave Peterson" wrote:

How about just recording a macro when you do it manually?

Mamoudou wrote:

I want to create macros that relate to selected cells, not absolute or
relative references; specifically, merge and unmerge selected cells. Excel in
Office 2003, Win XP.

--

Dave Peterson
When I do that, the macro records the references of that instance of merging; when I use the macro at a new location, it is still the original cells that get merged. Hence the need for "Merge Selection".


--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default create macro "merge selected cells"?

In xl2003, there is an icon on the Formatting toolbar.

I have no idea why MS decided not to include a keyboard shortcut.

Mamoudou wrote:

Thanx for your interest. I have never used code, only recorded the
keystrokes. I should try that, as in the post above. Why is there no keyboard
shortcut?

"Dave Peterson" wrote:

Share your recorded code.

Sometimes, it's a simple change.

Changing a specific range("a1:x1") reference to Selection may work.

Mamoudou wrote:

"Dave Peterson" wrote:

How about just recording a macro when you do it manually?

Mamoudou wrote:

I want to create macros that relate to selected cells, not absolute or
relative references; specifically, merge and unmerge selected cells. Excel in
Office 2003, Win XP.

--

Dave Peterson
When I do that, the macro records the references of that instance of merging; when I use the macro at a new location, it is still the original cells that get merged. Hence the need for "Merge Selection".


--

Dave Peterson


--

Dave Peterson
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
in Excel: How do I change "selected cells" highlight color? flameretired New Users to Excel 5 June 24th 09 08:39 PM
"Center across selection" rather than "Merge cells" Elardus Excel Discussion (Misc queries) 10 November 6th 08 02:28 PM
Create a "cell button" to hide selected cells. Shoolin Patel Excel Worksheet Functions 12 July 30th 07 11:00 AM
create links to check boxes marked "good" fair"and "bad" pjb Excel Worksheet Functions 3 April 20th 06 02:17 AM
Losing "merge-cells" formatting when populating Worksheet from VBA Cardio Excel Programming 1 November 22nd 05 03:43 AM


All times are GMT +1. The time now is 03:24 AM.

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

About Us

"It's about Microsoft Excel"