Macro to type text

Excel 2000

This seems simple, but . . .

I want to use one of the function keys, F10 for example, to automatically
type some simple text into the current cell. When I use the Macro Recorder
and I type the text, NA, and hit Enter. It creates code:
     ActiveCell.Text.FormulaR1C1 = "NA"
    Range ("R25") .Select
This gives me the correct text, NA, but always moves the active cell to R25,
instead of the next cell down (like hitting Enter).

Of course, presently I have to use Crtl+ any letter. I would preter not
having to use Crtl. I want to use F10.

How?

Brad H.



0
5/7/2004 7:11:24 PM
excel.misc 78881 articles. 5 followers. Follow

3 Replies
417 Views

Similar Articles

[PageSpeed] 12

Try this

Sub test()
ActiveCell.Value = "NA"
ActiveCell.Offset(1, 0).Select
End Sub


-- 
Regards Ron de Bruin
http://www.rondebruin.nl


"Bradley C. Hammerstrom" <bhammerstrom@NOSPAMrhadcock.com> wrote in message news:OWZWcdGNEHA.3016@tk2msftngp13.phx.gbl...
> Excel 2000
>
> This seems simple, but . . .
>
> I want to use one of the function keys, F10 for example, to automatically
> type some simple text into the current cell. When I use the Macro Recorder
> and I type the text, NA, and hit Enter. It creates code:
>      ActiveCell.Text.FormulaR1C1 = "NA"
>     Range ("R25") .Select
> This gives me the correct text, NA, but always moves the active cell to R25,
> instead of the next cell down (like hitting Enter).
>
> Of course, presently I have to use Crtl+ any letter. I would preter not
> having to use Crtl. I want to use F10.
>
> How?
>
> Brad H.
>
>
>


0
rondebruin (3790)
5/7/2004 7:57:39 PM
Thanks, Ron,

I also got it to work by hitting Crl+Enter during recording. This is just
like Enter without moving the cursor to the next cell. The code created
simply eliminates the Select method line entirely.

I'm still looking for a way to assign F10 to a macro of my choosing. . .

Brad H.


0
5/7/2004 9:08:54 PM
Look in the VBA help for "OnKey" Brad


-- 
Regards Ron de Bruin
http://www.rondebruin.nl


"Bradley C. Hammerstrom" <bhammerstrom@NOSPAMrhadcock.com> wrote in message news:e%23CWGfHNEHA.3472@TK2MSFTNGP10.phx.gbl...
> Thanks, Ron,
>
> I also got it to work by hitting Crl+Enter during recording. This is just
> like Enter without moving the cursor to the next cell. The code created
> simply eliminates the Select method line entirely.
>
> I'm still looking for a way to assign F10 to a macro of my choosing. . .
>
> Brad H.
>
>


0
rondebruin (3790)
5/7/2004 9:15:02 PM
Reply:

Similar Artilces:

Using Microsoft Help: Add Text Boxes, etc.
Fellow posters: I have MS Excel 2000 (v. 9.0.3821) and need help on working with its map function--the MS Map in my Excel is MapInfo version 8.0. I have never used it before. My eventual goal is to import this map into a MS Word document. For a upcoming report, I'd like to do a few maps of the U.S., where I'd be able to congregate neighboring states together into separate regions and add some text annotation. I'd also like to individually color selected states. After receiving help from a Word group and some hair-pulling, I managed to create a map in MS Map, put it in MS Excel, ...

Translating Dialog text
Hello, Firstly I am new to MFC so apologies for what is I am assuming a very basic question! Summary: I am writing an MFC application which contains one simple dialog and up to 6 message boxes. I need to provide the application in both English and German. The dialog contains a title and static text, both of which will need to be translated. The buttons on the dialog will also need to be translated. The 6 message boxes contain text to be translated, titles to be translated and the button names must also be transated. In total there will only be about 10 strings to be translated. My questions ...

Splitting text divided by carriage returns
I have a report in which multiple responses are provided in a single cell. The responses appear on different lines as if these had been added with a carriage return (i.e. as entered using ALT and RETURN). I know that you can normally split cell contents into columns using the Convert Text to Columns Wizard under DATA / TEXT TO COLUMNS and then Delimited, however I don't know what the character or feature would be for soft carriage returns. Any ideas on this or an alternate methodology? Use the sequence ALT + 010 in the other delimiter box. Use the Number pad to enter t...

how do I prevent Excel from spilling text into adjacent columns?
When I have columns that are skinnier than the text they contain, the text spills into the adjacest column(s). How do I prevent this? It makes the spreadsheet very messy looking when I squeeze the columns to get an overview of the spreadsheet. Hi format these cells with word wrap ('format - Cells - alignment') "cp" wrote: > When I have columns that are skinnier than the text they contain, the text > spills into the adjacest column(s). How do I prevent this? It makes the > spreadsheet very messy looking when I squeeze the columns to get an overview > of t...

Error Msg "You must enter a number between 0,00 and 100 000 000 000,00" pops up, when i enter data into fields, whose type is 'Decimal'.
Hi everyone, i am new to MS CRM. Therefore please bear with me. i have got this error msg "You must enter a number between 0,00 and 100 000 000 000,00." when i enter values into fields whose type is 'Decimal'. I searched through the KB articles and i found that this problem can be solved using an Update Rollup 2 for CRM 1.2. However i am using CRM 4.0 right now. Therefore is there any other suggestion to solve this problem? Warmest Regards, Thomas Thomas - what exactly is your issue here? the message you...

How to copy non-contiguous columns to a text file
I would like to copy columns just B and J to a tab-delimited text file. Excel will allow me to select those 2 columns and perform various operations on them (bold, center, etc.). But when I try to copy (Ctrl-C) and then paste into NotePad (Ctrl-V), I get all of the intervening columns. I know I can rearrange the columns, but I'd like to know if there is a way to copy non-contiguous columns. Hi Jennifer, Hold Cntrl and select the B Column Data and hold the Cntrl and select the J Column data also. Now the B and J Column data only will be getting selected. Do Cntrl+C to copy the data and ...

Run Macro on Change in Worksheet
Hello, I would like to run a macro when a change is made in a given column on a worksheet (such as column B). I know I need to use: Private Sub Worksheet_SelectionChange(ByVal Target As Range) end sub Not sure how this works though. Thanks for your help. Bill Bill, First test if the column is selected If Target.Column = 2 Then and then call your macro myMacro end the If statement EndIf The only other thing to say is that this code goes in the sheet module of the sheet in question (right-click on the sheet tab, select View Code from the menu, and put the code in t...

Form error "Type Mismatch"
Hi, In my time tracking db, I have a hidden form that opens immediately after the switchboard "fWorkLogHidden". If someone forgot to log out of the db (by filling in StopTime) the previous day, there is another form "fWorkLogPreviousDay" that opens from the FormLoad event of the hidden form, requiring stop time to be filled in the next time the db opens. Below is code I currently have in place, but get error "13 Type Mismatch". DoCmd.OpenForm "fWorklogpreviousday", acNormal, , "stoptime isnull" And "starttime BETWEEN Date() and (Da...

Possible to change default "All Open Workbooks" to "This Workbook" in macro dialogue box?
This is something that is always a problem for me. Whenever I'm selecting macros to run they are _always_, nearly without any exceptions at all, macros that are found in the current workbook. I'm always having to change the option of "All Open Workbooks" to "This Workbook" whenever I open the macro dialogue box. Can we change that (even if it's a reg edit)? Tx. :oD ...

Macros for adjusting graphs every day
I have a number of reporting graphs linked into a spreadsheet which I update on a daily basis. I then need to adjust where the graphs read to include the days data. This is tedious and time consuming with 16 graphs to adjust. Is there a macro or something I could write that would adjust the data range automatically in excel97?Adjustment could be based on a date easily enough. -- Jimmy =?Utf-8?B?SmltbXkgRA==?= <jimmydean@bigpond.net.nz> wrote in news:C5EABB06-3ED4-4716-AC7F-8F82F5E1BBC0@microsoft.com: > I have a number of reporting graphs linked into a spreadsheet > which I ...

Export range to text file
I need to export a range from excel to a text file with a delimiter such as a comma or semicolon. I want to be able to have some kind of macro that will check each row and if a row is blank then it will stop there and only export the rows that has data. Which is why I was thinking of using a range, or array. I do have some formulas in the cells so do not want that to show up in the export. Thanks, -- Matt Scheperle mscheperle@gmail.com I have this code that I use to create a csv for later update some values in a system I hope it works Dim ColId As Integer Di...

Equivalence between Macros and Messages
As a requeriment for an application (nothing to do about it), I've to avoid the use of ON_COMMAND, ON_UPDATE_UI_COMMAND and other message maps. I can do this implementing explicit message handling in WindowProc, for example, instead of ON_COMMAND(ID_RESOURCE,functionHandler) I've an entry in WindowProc as: LRESULT CMainFrame::WindowProc( UINT message, WPARAM wParam, LPARAM lParam) { .... if((message == WM_COMMAND) && (wParam == ID_RESOURCE)) { [do something] } } My question is: Is any document that explains the relation between other macros and messages? For ...

pasting formulae to entire column in macro
Apologies to all if this is really easy! I'm a fairly new user who ha been thrown in at the deep end. I am trying to create a macro in which I will add a new column, write formula in one cell and then copy that formula to every cell in tha column. The spreadsheet in which the macro runs varies in the number of lines All I seem to be able to do is paste the formula to all 65,000 cells o to a fixed amount of cells. Can anyone help please? Thanks Coli -- Message posted from http://www.ExcelForum.com Hi use something like the following Sub insert_formulas() Dim LastRow As Long LastRo...

Macro error, range object need data?
Hi all How can I improve my macro which has a macro error like below: "Macro error The method can't be used in the applied context. Specifically, some Range object methods require that the range contain data. If the range does not contain data, the method fails." How can I modify range object which has some empty data in the range? Thanks Daniel Hi, Does the range you are referencing contain data? Empty cells or those containing #N/A can cause problems when using the charting section of the object model. Cheers Andy Daniel wrote: > Hi all > How can I improve ...

Macro Problem #3
Hi I run WinXP with Excel 2K I have a number if spreadsheets that have macros in them. They all work fine. I have created a spreadsheet with a "dashboard" in it. That is to say it is a spreadsheet with a number of autoshapes (buttons) that have hyperlinks attached to them that when each one is selected they open the spreadsheet that they are hyperlinked too. This works fine. Now for my problem. I have moved all of the spreadsheets (including the one with the dashboard in it) onto a server drive. When I select one of the dashboard buttons it opens the desired spreadsheet on ...

How to add keyboard shortcut to macro un add-in ?
How to add keyboard shortcut to macro un add-in ? I just have a function and I save it as excel addin. and copied it to addin folder. I want to execute the macro with a keyboard shortcut for example ctrl-r preferablely I want to list the macros and select because later on I make other macros. two cases, I need Thanks in advance. You can't execute a function with a keyboard shortcut - you must call it from another macro or from a worksheet formula like: =3Dmy_function(parameters) in which case it will return the result to that cell. Hope this helps. Pete On Apr 7, 3:26=A0pm, "...

Floating Text Box? Is this possible?
I want to put a disclaimer at the bottom of one of my excel 2002 documents but I don't want to screw up my rows and colums. Is there any way I can create a Floating text box that would work like a paragraph at the bottom of the page? Or if anyone knows a better way to do this. Thanks ohh it's oon the drawing tool bar! >-----Original Message----- >I want to put a disclaimer at the bottom of one of my >excel 2002 documents but I don't want to screw up my rows >and colums. Is there any way I can create a Floating text >box that would work like a paragraph...

show text after formulas
I have some formulas with text added to the result. For example, I might have a result of: 4.9¢/kWh In the formula cell, I set the numeric format to number, one digit after decimal. How do I retain the format when I have the numeric set to show commas? When I want to show a result of: 2,345,899 kWh Excel gives me a result of: 2345899 kWH. Why is it ignoring my format when I introduce text? A formula example when this happens might be: =ROUND(((G40/H45)*D19*100 ),0)&"kWh" help! this is driving me crazy!! I want to show units in the same cell, but these n...

Is there a way to have two separate macro folders?
I found help for putting macros out in a common area for a whole department to use (have not tried yet, though). I was wondering if there was a way to have separate macro folders: one for personal macros I use, and another for macros that a department or company would use. That way if I needed a macro I seldom use or others seldom use we could switch folders, without too much trouble. Thank you. Have you tried a Network Drive for the common macros and your C:\ drive for personal macros? -- Milly Staples [MVP - Outlook] ALWAYS post your Outlook version! Post all rep...

Converting Text to Date
Hi, Is anybody can tell me, how to convert from text data to Date?. I have a table imported from Text file, text file only recognize text & number only. One of the field (we call: TxtDate) they have is '20070515" (yyyymmdd) has to be in date format. How can I convert it to our regular format (mm/dd/yy), so I can calculate it? I tried using Format(mid(TXTDate,5,2)&"/"mid(7,2)&"/"mid(3,2),"mm/dd/yy"). It works, but I still can't use it as a date, so I can't put a parameter on it. Thanks in advance KF -- Message posted via AccessMo...

Can't fit all the text in the box, even though there is room for it.
Trying to fit several sentences of text in a spreadsheet. Seems OK, but "cuts off" when I print it. There seems to be more room for the text but it just won't print. It also appears above the area in a separate box while I'm working with it and that DOES have all the text that I've typed, but that box disappears in the printing or View mode. Why won't my text enter? I've merged the cells and alligned as suggested by help. Thanks, JB ...

How do record a macro in excel that will repeat for other cell ra.
I have combined two worksheets that contain different contact information that I have sorted by last name. I can now see that a large number of folks were in both lists but each worksheet contained different but valuable information. How can I merge the duplicate rows so I have one entry with all the contact information from both worksheets? Hi you may use VLOOKUP for this. See: http://www.contextures.com/xlFunctions02.html -- Regards Frank Kabel Frankfurt, Germany "heymonsky" <heymonsky@discussions.microsoft.com> schrieb im Newsbeitrag news:4798745D-CEC5-4F72-8769-F...

SaveAS macro Query
Hi, Can anyone help me with my macro? Basically, it is supposed to look at the book name and rename it if it is call Quotes & Orders to a value ( which is a job number) in C2. in an ideal world, i would like to save it to the following: S:/Clients/(get client name from cell C1)/(Get Project Name from C3/(Get Job Number from C2) Quotes & Orders.xls Any Help Greatly appreciated. Regards, Nigel sub SaveThisBook() Revision = ActiveWorkbook.Name RevName = Range("2").Value if ActiveWorkbook.Name = "Quotes & Orders.xls" then SaveAs = RevName & " "...

remove enable macro prompt
I have a spreadsheet which originally had macros attached - now al deleted. Spreadsheet is still promting for enabling of macros whe being opened - how do i stop it happening -- Redde ----------------------------------------------------------------------- Redden's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2637 View this thread: http://www.excelforum.com/showthread.php?threadid=39641 hi, You may have deleted the macros but the modules are still there. open the VB editor (alt +F11). on the left, expand your vb project(file name). click on any mondule that m...

Make macro available in all workbooks
Hey there I have created a macro to run on a particular csv file. The contents of this file are the result of a report ran from another application. I need the macro to be available to all workbooks, so that when the macro is to be run on the file, it will always be available. I have tried selecting - Macros in "All Open Workbooks", but this does not seem to retain the macro when a different file has been opened Can any 1 help? Cass Hi normally saving your file in the personal.xls should be sufficient. Aother option would be to create an addin for this macro and install thi...