Line-break in a cell without ALT-ENTER?

Is there a way to do this?

I would like to make it so when the user hits "ENTER", it doesn't go to
the next cell.  I want it to just make a line-break in the cell.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

0
10/26/2003 8:19:57 AM
excel.misc 78881 articles. 5 followers. Follow

1 Replies
320 Views

Similar Articles

[PageSpeed] 27

You could use a couple of macros, but before you do that, how would you really
hit the enter key?

I think I wouldn't really do this, but if had to, I'd remap the enter key from
the numeric keyboard only.  Then I could still use the QWERY enter key for
normal usage.

Option Explicit
Sub remapEnterToAltEnter()
    Application.OnKey "{enter}", "doAltEnter"   'numeric key pad
    'Application.OnKey "~", "doAltEnter"         'QWERTY
End Sub
Sub doAltEnter()
    If ActiveCell.HasFormula Then
        'do nothing
    Else
        ActiveCell.Value = ActiveCell.Value & Chr(10)
        SendKeys "{f2}{end}{right}"
    End If
End Sub
Sub ResetEnterKeys()
    Application.OnKey "{enter}"                 'numeric
    'Application.OnKey "~"                       'QWERTY
End Sub

I commented out the QWERTY lines if you decide to use them.   (on the other
hand, isn't it easier to just hit alt-enter than to remember which enter key
does what?  <vbg>.)


kenji4861 wrote:
> 
> Is there a way to do this?
> 
> I would like to make it so when the user hits "ENTER", it doesn't go to
> the next cell.  I want it to just make a line-break in the cell.
> 
> ------------------------------------------------
> ~~ Message posted from http://www.ExcelTip.com/
> ~~ View and post usenet messages directly from http://www.ExcelForum.com/

-- 

Dave Peterson
ec35720@msn.com
0
ec35720 (10082)
10/26/2003 1:30:30 PM
Reply:

Similar Artilces:

Cell.Find in VBA
Hi, I have the following VBA Macro: Set FoundCell = .Cells.Find(What:="199", _ After:=.Cells(1), LookIn:=xlValues, _ LookAt:=xlWhole, SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious, _ MatchCase:=False) I don't how to write a VBA macro that would cells.find all 5-digit numbers. Here's an example: Column A 199 199 75781 75899 199 80012 Thanks, Hi I think you have to loop through all cells and check the length/value of each cell -- Regards Frank Kabel Frankfurt, Germany "Jeff" <Jeff@discussions.microsoft.com> schrieb im Newsbeitrag news:D3CEA329-2A...

OR cell range
Hi, I have a formula that works fine to produce a result of either Pass or Fail in a cell. This formula looks at 4 cells thus: =IF(OR(J133="Fail",J134="Fail",J135="Fail",J136="Fail"),"Fail","Pass") I now have a requirement where this will cover more than 20 cells in a column and rather than write a condition for each cell is there some other way to do this. I tried naming a range of cells but that doesn't work. Many thanks Hi =IF(COUNTIF(J133:J153,"Fail"),"Fail","Pass") -- Regards R...

Can't move from cell to cell
I'm trying to move from cell to cell with my arrow buttons but it doesn't let me. It appears the highlighted cell is locked and the only way I can move from cell to cell is with my mouse pointer. My arrow buttons do work because I tried it in other programs. Any help will be appreciated. Ann, Looks like you have Scroll Lock turned on. Turn it off with the key on = the top right of the keyboard. HTH Anders Silv=E9n "ann smith" <compcoff@hotmail.com> skrev i meddelandet = news:e6LPf$%23oDHA.2424@TK2MSFTNGP10.phx.gbl... > I'm trying to move from cell to ce...

Macro to break up a csv file
Please help This is a few lines of a csv file that I have. I have it open in an Excel workbook. I need to write/record a macro that creates a new worksheet and cuts and pastes the data into them at every line that contains an 'R' on the left hand side. The amount of rows that contain data after the 'R' row are variable throughout the file. Thank you. H 11/12/2003 08:00:12 R 7926 1601 N B 11/12/2003 11/12/2003 10:15 L BX10A T10 2 18 6 L BX10A T10 5 71 29 L T20 43 63 22 L T21 BM 9 1 L T21 MB 6 1 ...

how to highlight cells ?
I have a spreadsheet that consists of 100 columns with 100 rows; How can I highlight a cell whose value exceeds 500? tia From menu select Format|Conditional formatting Set Condition Cells value is greater than 500. Select the format you would need. Click OK If this post helps click Yes -------------- Jacob Skaria "Sul@MS" wrote: > I have a spreadsheet that consists of 100 columns with 100 rows; > > How can I highlight a cell whose value exceeds 500? tia > Please review this article http://www.contextures.com/xlcondFormat01.html If this post helps click Yes -...

interpolating blank cells
I want to graph the data from a table, but I want the charts to interpolate the lines inbetween the "blank" cells. All of the cells have formulas in them because they are pulling the data from another worksheet, but some of them appear blank because there is no data for that time slot. I have tried the Tools:Options:Charts: Interpolate blank cells, but I can't get it to work. Please help. Thanks. You see a cell with a formula is not blank Replace you formula by =IF(your-formula="",NA(), your_formula) Such as =IF(Sheet1A1="",NA(),Sheet!A1) best wishes ...

Insert random number only if cell empty
Hello. I'd like my spreadsheet to place a 7 digit random number into a cell only the cell is empty, otherwise leave the contents as is. I simply don't want the number to change if one is already present. I currently keep the number static by pressing F9 when I enter the RAND formula, but that forces me to manually change the number when I save the spreadsheet to another name. I'd like the spreadsheet to automatically calculate a new number in the cell as soon as I erase the previous number in that cell. Any help on this issue will be appreciated. Thanks. "M.L.&qu...

Cell range expand or contract
I inherited an Excel workbook that pulls a great deal of its data from an Access db using MSQuery. Some of the worksheets contain bar charts that get their source data from the information pulled in from Access. I am having trouble finding a way to make the cell ranges that hold the chart source data expand or contract depending on the amount of data. For example, one month the source for chart A may be Data! A1:B5. The next month there may have been more transactions and the range would be Data!A1:B10. Right now the user goes in and manually adjusts the cell ranges. Is there some way to m...

Macro do delete values in cells
If I tipe a value (text) in N I want the values in the same row in O P & A to be deleted. Please help ...

Considering cells colored via conditional formatting
EXCEL 2007 Any piece of code which, for example, select or count the cells which are colored yellow, amongst the currently selected range, because of meeting ANY criteria of CONDITIONAL FORMATTING. In other words, considering cells which are not actually possessing yellow as an interior color but being displayed so because of CONDITIONAL FORMATTING. -- Thanx in advance, Best Regards, Faraz There are two pages at Chip Pearson's wepage that you need to look at. the 2nd gives a detailed example of how to do what you want. 'Conditional Formatting' (http:/...

Can I split a cell diagonally, with text in each triangle ?
I am putting together a calendar on excel and would like to split a cell diagnolly, colour each section and be able to type text in each triangle. Is this possible and if so how ? Many thanks Helen No it is not possible! (Now that I have said that someone will probably come in with a method) Youi could, however, make two triangles with different fills, and put text in them or make the fills partially tranparent and put text in the cells under them "Helen T" wrote: > I am putting together a calendar on excel and would like to split a cell > diagnolly, colour each ...

auto email if cell value changed
I'm using a workbook to schedule staff. Each month is a worksheet then I have some counts that are done. The days of the month are in the top row and the names of the staff in the first column. We've set up autorefresh on web pages so the schedule is always available but... people still don't notice shift changes. I want excel to generate an email to the person (we're running exchange too) if a cell value is changed. I was thinking of a couple of steps. 1. So they only get emails about the current month and the month ahead -- Have a cell at the top with YES/NO in i...

VBA to count periods in a single cell
I am looking to count the number of periods within a single cell using vba. For instance if I have 4 cells that contain the following: 5M09-0000700.01.10 5M09-0000700.01.10.10 5M09-0000700.01.10.10.10 5M09-0000700.01.10.10.20 Thus the output of the code for the first cell should be '2', the second cell output would be '3', and the third/fourht cells would be '4' because that many period characters were encountered. Data within these cells will contain letters, numbers, periods, a few spaces and the "-" dash symbol. Any help is greatly appre...

Need to verify cell location before running a macro, how?
I am requesting users to click on a cell in column B (in which they are actually selecting a row of reference information), then to click on an icon which launches a macro that runs relevant to the row selected in column B. I would like Excel to verify that the selected cell is actually in column B prior to running the macro. If a cell in column B is not selected, I want to present a pop up message reminding them to select a cell in column B. Please help! If ActiveCell.Column <> 2 Then MsgBox "Don't Do That" Exit Sub End If -- Jim Cone Portland, Oregon USA http:...

Selecting a named range, the name of the named range is in a cell
What i want to do is the following : I have a cell which i have named "ExtraRisk". This cell contains text : example "Electricity", which is also the name of a range. Now i want to select this named range "Electricity" & copy the range How do i do this. What i have so far is : Sub Risicos_toevoegen() ..... Sheets("MASTER").Select 'I'm stuck here.... Application.Goto Reference:="ExtraRisk" 'I do not want to copy the named range "ExtraRisk", but i want to copy the named range where the va...

Enter network password #10
Upgraded to Outlook 2002 (XP) and I keep getting this annoying Enter Network Password message on all my e-mail accounts. How to fix please? Most likely it wants the password for your email account. Did you enter it correctly when you set up your email accounts? "Edison Stewart" <edison.stewart@sympatico.ca> wrote in message news:1dd5401c454d6$8df6e900$a301280a@phx.gbl... > Upgraded to Outlook 2002 (XP) and I keep getting this > annoying Enter Network Password message on all my e-mail > accounts. How to fix please? See if this helps: For Outlook 2000 or 2002 o...

OnKeyDown .... for the <ENTER> Key
As silly as this may sound, I can't find the CWnd member function (if any) that handles the message when the <ENTER> key is pressed. First I thought OnKeyDown, but it doesn't work. Thanks a lot See if these KB articles help you: Q102589 Q122489 "Abelardo Vacca" <vacca@gebo-indust.com> wrote in message news:01d201c34bc8$82f2d2c0$a401280a@phx.gbl... > As silly as this may sound, I can't find the CWnd member > function (if any) that handles the message when the > <ENTER> key is pressed. First I thought OnKeyDown, but it > doesn't work...

How do I freeze lines on a form
I have a form that was created in word that co-workers have to type on with client information. How do I make the lines & boxes freeze so that when they do type on it it doesn't move? Insert a table. Put each form field in a separate cell of the table. In the Table Properties dialog, Rows tab, set the row heights to "Exactly" values. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. rauten46 wrote: > I have a form that was created i...

Entering the same value into two table fields at the same time
Say that there is a table which has 2 fields (A, B) There is a form [Form1] (data entry type) to enter data for A by `TextBoxA`. There is also one more `TextBoxB` which is Not Visible. My target is to record the value of (entered thtough `TextBoxA`) into B field of the table as well. So I write down a code "Before Insert" of the Form1 that: " Form_Form1.TextBoxB = Form_Form1.TextBoxA " It is not recording A values into the field B... Where am I wrong? Can you help me please? Sory !!! When I write down the same code into `OnExit` of TextBoxA, it is working...!! yes, ...

How to start cluster from command line?
We are running Windows 2003 domain and Exchange 2003 cluster. I had to take ALL of the cluster resources offline install a Microsoft fix. Now the cluster won't show up in Cluster Administrator so I can't bring the cluster back online. Anyone know the command line commands to do this, or how I open a connection to the cluster in Cluster Administrator? TIA, Lamar The virtual node name is "stms". Whe I try to connect to that cluster it says that the cluster service is not running on that node. Lamar "Lamar Thomas" <none@none.com> wrote in me...

Counting highlighted cells?
Is there a way to count cells in a column which have been highlighted or text that has been italicised??. As i have a column full of dates, and when something is completed the suggested date is changed to the actual date, highlighted and italicised. I need to keep a count on the completed dates. Check out http://cpearson.com/excel/colors.htm In article <BC6F544F-DF88-41A8-8F15-5A8D460F73FE@microsoft.com>, "Josh - Westfield Australia" <Josh - Westfield Australia@discussions.microsoft.com> wrote: > Is there a way to count cells in a column which have been ...

Two formulas in on cell based on two numbers in another cell?
Hi, Not sure this is possible but...I have a cell that has a number range in it and based on an amount in another cell want to calculate a new range. For example: Initial Range: A1 = 10 - 12 Calc Amount: A2 = 5 Final Range: A3 = 50 - 60 I think I can get the results by concatenating two formulas I'm just not sure how to enter the original numbers (A1) or how to distinguish between the two in the final formula (A3) Using Excel 2003. Hope this makes sense. Thanks. I would put the range in two different cells (eg A1 and B1). Then the multiplication is easy. If you ...

Compiling MFC project from command line...
Hi, How do I compile and link MFC activex project from command line in MSVC 6.0 Is there any tool which generates such info... Help ! sandSpiderX If you look in the project settings for your ActiveX project, you will see the command line that is used by the IDE for building the project. You should be able to use that command line directly. "sandSpider" <m74.piscean@gmail.com> wrote in message news:1120655631.691634.137580@o13g2000cwo.googlegroups.com... > Hi, > > How do I compile and link MFC activex project from command line in MSVC > 6.0 > > Is the...

How to view email with pictures in-line in Outlook
How do you view email that comes attahced with pictures in Outlook XP just like you would in Outlook Express? Please advise. Thanz! Cheers! Unless the sender embeds the pictures in the message, you can't. Outlook doesn't do that by itself. -- PATRICK REED [Outlook - MVP]~~~~~~ -Microsoft Certified Professional (MCP) -Have you checked http://www.slipstick.com? -Please post your Outlook version! "Albert" <hongky@singnet.com.sg> wrote in message news:b46b01c4797c$9eab7980$a601280a@phx.gbl... > How do you view email that comes attahced with pictures > i...

Line selection for formating in Excel chart
Have "plain vanilla" line chart in excel spread sheet. Data series consist of several lines closely space. Normally I can select and RClick a single series for formating such as line color and thickness. Is it possible to simultaneously select all data series to change a common format such as line thickness. I'd like to do this without individually selecting each line while the control key is depressed. (lazy and not that good-a shot). ~Dave Hi, No you can not select multiple series, like you can with shape objects. The only time saver is, select 1 on the series and the f...