Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a generic MACRO question. I undestand the relative/absolut
principle. However, when using the "Record a new macro" option, an set the macro to Relative, it does not appear to be repeating the sam key stokes I typed. Example- Say I have a column of text and I want to delete the second characte of each cell. I clicked Record amacro, set to relative, then keyed: Edit, Home, Right, Delete, Enter Then stopped recording. If my original column is: Dog Cat Mouse I want Dg Ct Muse But I get Dg Dg Dg Thanks, SK -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Whatever you do when you are in cell edit mode is *not* recorded by the macro recorder, just the result when you press Enter, so what you get is 'Enter "Dg" in the cell', *not* 'delete the second character in the cell'. Try the following macro, it deletes the second character in each selected cell, assuming the selected cells contain text strings. You can change Selection to any range. '----- Option Explicit Sub test637() Dim cCell As Range For Each cCell In Selection With cCell .Value = Left(.Value, 1) & Mid(.Value, 3) End With Next End Sub '----- HTH Anders Silven "esskaykay " skrev i meddelandet ... I have a generic MACRO question. I undestand the relative/absolute principle. However, when using the "Record a new macro" option, and set the macro to Relative, it does not appear to be repeating the same key stokes I typed. Example- Say I have a column of text and I want to delete the second character of each cell. I clicked Record amacro, set to relative, then keyed: Edit, Home, Right, Delete, Enter Then stopped recording. If my original column is: Dog Cat Mouse I want Dg Ct Muse But I get Dg Dg Dg Thanks, SKK --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for your response Anders.
What I really wanted to know was 'why do I lose my routine afte entering the Edit mode?' (you answered that). I remember the old Lotu macro language where you could enter commands directly as the macr code. Too bad that's gone, particularly for us non-VB progammers. realize how much more powerful VBA is, however most of the things want to antomate could be done with simple key stroke commands. O well, that's progress... Thanks again, SK -- Message posted from http://www.ExcelForum.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi again,
Thanks for the feedback. Hope you find a way to get on. Regards Anders Silven "esskaykay " skrev i meddelandet ... Thanks for your response Anders. What I really wanted to know was 'why do I lose my routine after entering the Edit mode?' (you answered that). I remember the old Lotus macro language where you could enter commands directly as the macro code. Too bad that's gone, particularly for us non-VB progammers. I realize how much more powerful VBA is, however most of the things I want to antomate could be done with simple key stroke commands. Oh well, that's progress... Thanks again, SKK --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
The Relative Macro | Excel Discussion (Misc queries) | |||
relative value in macro | Excel Discussion (Misc queries) | |||
Relative Values in a Macro | Excel Programming | |||
Macro assignment to button gets reassigned | Excel Programming | |||
relative ref. macro | Excel Programming |