Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
in Excel: How do I change "selected cells" highlight color? | New Users to Excel | |||
"Center across selection" rather than "Merge cells" | Excel Discussion (Misc queries) | |||
Create a "cell button" to hide selected cells. | Excel Worksheet Functions | |||
create links to check boxes marked "good" fair"and "bad" | Excel Worksheet Functions | |||
Losing "merge-cells" formatting when populating Worksheet from VBA | Excel Programming |