Keyboard Macro Just Copies Content of Previous Cell

I created a simple keyboard macro to edit the contents of a cell by simply 
inserting a "b" in a particular position.  For example, I have a series of 
alphanumeric numbers that start with S1253, e.g., S12536675.  I wanted to 
insert a "b" after the first five digits on the left to revise the series of 
alphanumeric numbers to start with S1253b, e.g..S1253b6675.  However, after 
creating the keyboard macro, when I run the macro on the next cell to be 
edited (i.e., S12536676), the macro simply copies the contents of the 
original cell that I edited when I first created the keyboard macro (i.e., 
S1253b6675), rather than simply inserting a "b" n the fifth position from the 
left as I desired. Any ideas on what is going on here???
-- 
Andy
0
Andy1200 (318)
10/24/2005 10:42:05 PM
excel.misc 78881 articles. 5 followers. Follow

1 Replies
689 Views

Similar Articles

[PageSpeed] 50

It is probably hard-coded as say

    Activecell.Value = "S1253b6675"

change it to

    With Activecell
        .Value = Left(.value,4) & "b" & _
                    Right(.Value, Len(.Value) - 4)
    End WIth

-- 

HTH

RP
(remove nothere from the email address if mailing direct)


"Andy" <Andy@discussions.microsoft.com> wrote in message
news:632A70F6-A3AA-4D53-8AA5-4068A4CBC626@microsoft.com...
> I created a simple keyboard macro to edit the contents of a cell by simply
> inserting a "b" in a particular position.  For example, I have a series of
> alphanumeric numbers that start with S1253, e.g., S12536675.  I wanted to
> insert a "b" after the first five digits on the left to revise the series
of
> alphanumeric numbers to start with S1253b, e.g..S1253b6675.  However,
after
> creating the keyboard macro, when I run the macro on the next cell to be
> edited (i.e., S12536676), the macro simply copies the contents of the
> original cell that I edited when I first created the keyboard macro (i.e.,
> S1253b6675), rather than simply inserting a "b" n the fifth position from
the
> left as I desired. Any ideas on what is going on here???
> -- 
> Andy


0
bob.phillips1 (6510)
10/24/2005 10:54:38 PM
Reply:

Similar Artilces:

English keyboard
Hi All, How can I switch the keyboard to English (or to any other) from Access ? Thanks in advance Imre ...

Import/copy individual email addresses within global Distribution List Membership group to another?
Hello, is there a way to bulk extract the individual email addresses from an existing Distribution List Membership group and import/copy them into another new slightly different group instead of having to go in manually one-by-one when adding/assigning members in the 'Modify Members' section? Thanks in advance. R click and drag the DL to a new location. If you want it in the same location, just rename it. -- Russ Valentine "7777" <NoSpam@NoSpam.com> wrote in message news:OiHeB7muKHA.3896@TK2MSFTNGP02.phx.gbl... > Hello, is there a way to bulk ...

How can I increase the number of characters allowed in a cell?
After 255 characters (text) in a cell in Excel 97, the cell only displays a row of ####. If I double click the cell the text will appear but as soon as I move to another cell the pound symbols are displayed. I can't print the sheet with the text showing. Doesn't matter how I resize the cell. The Excel book says 255 characters are the max allowed per cell. Can this limitation be changed? for numbers: If you right click on the cell and choose format- select the number tab and then number, and then select the number of trailing decimals you prefer. If the cell width is not wide enoug...

Visio 2007: macros are disabled
i have Visio 2007 pro. i m trying to add a macro: tools > macro > macros... but then the "create" button is disabled. also the: tools > macro > record new macro... is disabled why? possibly tools => trust center => macro settings... al "shemesh" <shemesh@discussions.microsoft.com> wrote in message news:CFDCA5EA-36EF-421E-B3AA-96C01F8DF73C@microsoft.com... > i have Visio 2007 pro. > i m trying to add a macro: tools > macro > macros... > but then the "create" button is disabled. > > also the: tools > macro > r...

Making height of box in report dependent of content
Hi all, There are a few memo fields in my report, with variable amounts of possible content. How can I make the height of the box dependent of the content inside it? I already tried to figure out the information on http://www.mvps.org/access/reports/rpt0010.htm, but it was quite complicated. Is there an easier way to solve my problem? I hope someone is willing and able to help me; it would make me very happy. Bye! Sietske -- Set the can grow property of the controls for the memo fields to YES -- Set the can grow property of the section containing those controls to YES -- Make sure...

This item contains active content that cannot be displayed in the preview pane. Open the item to read its contents.
I have outlook 2000 with sp3, do have a custom form with vb code published as default form. In preview pane I get the error This item contains active content that cannot be displayed in the preview pane. Open the item to read its contents. However the same form published as default on another machine with outlook2000 with Sp1 does not give me the preview pane error. Please help. Thanks This is becaused of the enhanced security added with the Service Packs; no code can be executed in the Preview Pane. You might want to check your options with the developers in the outlook.program_vba news...

exclude cells with certain criteria
I have a large dataset (over 20,000 rows) with monthly performance of certain companies. column A is the date (A1-A12 january-december for company x; A13-A24 january-december for company y etc.) Column B is the company name(B1-b12 company name x; B13-B24 company name y etc.) Column C is the monthly performance. e.g. c1 is performance of January of company x C2 is performance of February of company x, c13 is performance of January of company y and so on Some companies only reported performance for the months (e.g.) March till december. I want to exclude those companies that didn't r...

send object macro
I am trying to send a report or form from access via.email in an excel format so it can be edited and saved by another user. I am able to accomplish this except that the excel sheet is not formatted the way the person wants is there a better way of doing this or a different way that would have some kind of format? "jwebster1979" wrote: > except that the excel sheet is not formatted the way the person wants What format is this person expecting? Richard It is a fancy thing that looks better than it works it has some colors and and some drop downs. It wor...

Macro "stop recording" button
While I was recording a series of macros, I must have inadvertently chosen to make the "stop recording" button disappear from view. I could obviously stop the recordings from Tools>Macros, but it would save me a couple of clicks if I had the button back. I looked at all the obvious Option screens, without success. Any suggestions? Answer from Tom Ogilvy on this problem Start recording a macro, then right click on a blank area of a toolbar and select the stop recording toolbar. (or use View=>Toolbars from the menu) then click the stop button. Now when you record, the b...

Keyboard
Hi, I need to catch the keyboard key`s ctrl+alt+e in my MFC application how can I catch the combination of those three key`s??? How can I catch the F5 key??? For a normal key`s I use appwizard OnChar function or KeyDown. Thanks. hi, I guess you can try GetKeyState(VK_MENU) and GetKeyState(VK_CONTROL) when you response the OnChar or KeyDown message. "Dave" wrote: > Hi, > I need to catch the keyboard key`s ctrl+alt+e in my MFC application > how can I catch the combination of those three key`s??? > > How can I catch the F5 key??? > > &...

A List of Macro's
Hello, How can I create a List of Macro's with VBA. Thanks Luc Search the archives: http://google.com/advanced_group_search?q=group:*excel* using the term "list of macros" and you'll find several ways, depending on what you want to do with the list. In article <uszbIwT#DHA.3292@TK2MSFTNGP11.phx.gbl>, "Luc.Heyndrickx" <lucDitVerwijderenheyndrickx@skynet.be> wrote: > Hello, > > How can I create a List of Macro's with VBA. > > Thanks > > Luc > > > Thanks, Here's the solution: http://www.cpearson...

Shuts Down When Copying Worksheets
When I right-click on a worksheet tab, choose create a copy and tha past it into a new WORKBOOK Excel completely shuts down -- Message posted from http://www.ExcelForum.com I had that happen once to one of my workbooks. It was just one worksheet in a workbook with many worksheets. My first workaround was to save the original workbook (with the problem sheet). Right click, move or copy, but choose MOVE. excel didn't crash. Close the original workbook without saving. This worked ok for me, but scared the heck out of me. I was using xl97 at work where the problem occurred, and xl2002 a...

Conditional Formating for Formula Cells
Hi to all fantastic Excel champions, How do I get conditional formatting to change the format of any cell that contains a formula? Kind regards -- Andrew 'The Ox' Heath Brisbane, QLD Australia Hi Andrew, You can use a user defined function (see my formula.htm page): But it must be in the same workbook not your personal.xls to work in Conditional Formatting, though there is no harm in having it in both places. Function HasFormula(cell) HasFormula = cell.HasFormula End Function =hasformula(a1) use the above in your conditional formatting http://www.mvps.org/dmcritchie/exc...

hook keyboard and send as other keyvalue
hi, i have a problem to deal with global keyboard hooking . my application has to deal with a special keyboard, whitch asking that when press Shilft + A, it actually come out "#", Shift + B , it comes out "&".. and when shift is not pressed, the A is still A. i can not come out with the functionality no matter what.. i have to use global keyboard hooking since it is for the whole application LRESULT CALLBACK keyProc(int nCode,WPARAM wParam,LPARAM lParam) { PKBDLLHOOKSTRUCT hook = (PKBDLLHOOKSTRUCT)lParam; ??????? return CallNextHookEx(gHook, nCode, wPa...

In Excel, make Invert option to reverse order of copy selection.
In adition to transposing, another common operation in Excel is to invert the data. This would be a very helpful addition. Hi would do you mean exactly with 'iverting' data? -- Regards Frank Kabel Frankfurt, Germany "Deanbag12345" <Deanbag12345@discussions.microsoft.com> schrieb im Newsbeitrag news:21058CAC-63EC-420C-ADF3-C053476B4D66@microsoft.com... > In adition to transposing, another common operation in Excel is to invert the > data. This would be a very helpful addition. ...

Writing inside the Cells also
How can I set my Excell so I can write and edit also inside the cells? (Right now my Excell is set to edit in the window line after the "fx" funntion on the top only) Octvio, tools, options, edit, check edit directly in cell -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2002 & 2003 "Octavio" <octavioven@msn.com> wrote in message news:eTCjkHzIGHA.500@TK2MSFTNGP15.phx.gbl... > How can I set my Excell so I can wri...

Free Cell card game
Currently this card game appears at the top left of my 21 inch screen. I wish to have it in the centre touching the bottom of the screen each time it appears. How do I achieve this. Thank you for your interest. Bushy And your Microsoft Word question is? "Ernie from Dunedin NZ" <Ernie from Dunedin NZ@discussions.microsoft.com> wrote in message news:E05D1650-D1CA-4E1C-96FB-CF8EC0D17277@microsoft.com... : Currently this card game appears at the top left of my 21 inch screen. : I wish to have it in the centre touching the bottom of the screen each time : it appe...

How to copy existing report/project to new report/project
I have an SRS project and report. I want to create a new project and report from the existing one and save it/them under a new name. How do I do this? There is no "Save Project As" option on the File menu in Visual Studio. Hi Go to the folder where your solution is located , navigate to the needed ..RDL and just copy past it. Now, back to the solution in BID and add that report to. "Elaine" <Elaine@discussions.microsoft.com> wrote in message news:5F5D7500-0DA0-4EA9-9BAD-CA03364B47EA@microsoft.com... >I have an SRS project and report. I wa...

KEYBOARD NOT WORKING
I know some people may help better if I give more specific details to my problem.. So here goes: My keyboard works correctly with any other application, such as MSN, ICQ, Wordpad.. etc. However, when I open an Office application such as Word or Excel, it doesn't seem to type for me. I cannot type in the help section, can I type in the document or in those toolbars at the top for Fonts, etc. But if I specifically go to "Format >> Font", then yes, I can type in it. I have tried reinstalling Office already, that doesn't work. The hardware is fine, I can still...

copy when the date is entered
I have 12 sheets (months of the year) what I would like to be able to d is copy a row of data, say from Jan to Jul automatically when I enter date in the date collumn it also sends a copy into Jul. I have an excel book but can not find anything about this. Any ideas welcome. Thank -- Message posted from http://www.ExcelForum.com beesht, You will need to write some code in the worksheet_change event for each worksheet (possible only a pointer to a subroutine passing parameters) which tests which cell is being changed, and if the one you wnat, the do the copy you want. Steve >-----O...

Macros and Outlook?
Is there a way to "Record a macro" in OL 2002? I want to create rules via VB (and it looks like you can not do this reliabley in OL 2002), so my next option is to do a MACRO. Can I create a macro (that launches in excel ideally!) to modify an existing rule? Thanks Bruce You can't record a macro in Outlook, but you can write them. While it is = possible (not at all easy) to make some modifications of very simple = rules, my guess is that your project (as yet undescribed) will need more = than just simple rules. See http://www.slipstick.com/dev/vb.htm for = VB+Outlook resources...

Macro to work on selected cell
I have a macro that performs a routine on a row of data. My spreadsheet has many rows of data. How can I use only one macro that will work on any row that I have selected so that I don't need a different macro for every row? Thanks Barney You were NOT very specific. rows(activecell.row).copy >>> -- Don Guillett SalesAid Software dguillett1@austin.rr.com "Barney" <barneypo@no-spambellsouth.net> wrote in message news:pvj3i.3523$923.1779@bignews3.bellsouth.net... >I have a macro that performs a routine on a row of data. My spreadsheet >has many ro...

Outlook and XP Keyboard Access
I just had Windows XP installed on my machine and I am having problems with keyboard access in Outlook 2002. I do not use a mouse and I have my inbox set up with the preview pane. Prior to XP I could get to my inbox with CTRL+Shift+i and then tab around the panes (mail list, preview pane and folders). With XP I can not get a selection in any pane without turning off the preview pane and then turning it on again. Which I then have to repeat every time I use the shortcut to get back to the inbox. This is making me very frustrated. Does anyone have a solution? Thanks in advance! It m...

Copy Excel Chart from one book to other without links...
Hello All, I wanted to know if there is a way that I can copy the chart from one workbook to other with no external link. Say, I have a chart plotting data from Sheet 1 (A1:B100,B1:B100 of Sheet 1) and want to copy the chart to the next sheet with data at Sheet 2(A1:100,B1:B100 of Sheet 2) Thanks, Venkith -- venkith ------------------------------------------------------------------------ venkith's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=37294 View this thread: http://www.excelforum.com/showthread.php?threadid=570074 If it's an embedded chart, co...

I need help on a Macro
hi guys i really need to know how if i enter into cell F12 35 how can i get a message box to appear with say "You need to restock" written on it and the to buttons Yes and No? Can anybody help me???????????????????????? Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo ws_exit: Application.EnableEvents = False If Target.Address = "$F$12" And Target.Value = 35 Then MsgBox "You need to restock", vbYesNo End If ws_exit: Application.EnableEvents = True End Sub 'This is worksheet event code, which means that it needs...