Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 236
  • Last Modified:

MS excel

is there a way to create a numbered list in a cell?  so if i'm at cell a1 and i start typing, come to the end of my sentence and hit enter, my first sentence would be numbered 1 and when i hit enter the next sentence would be 2
0
JeffBeall
Asked:
JeffBeall
3 Solutions
 
dlmilleCommented:
Yes. An easy way is to type in column a - and put a formula in column b, starting at B1

[B1]=row() & ": " & A1

and copy that formula down.

I can give you more sophisticated stuff, but let me know if this works ok for you.

Dave
0
 
dlmilleCommented:
See attached with a macro.  Be sure to clear if you edit a line above.

The code puts the row number followed by a ":" in front of what was typed.

See below and attached...

it checks for any changes in the first column...

NumberSentenceAuto-r1.xlsm

Dave
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Cells(1, 1).EntireColumn) Is Nothing Then
        Application.EnableEvents = False
        Target.Value = Target.Row & " : " & Target.Value
        Application.EnableEvents = True
    End If
    
End Sub

Open in new window

0
 
MantvydasCommented:
I would do otherwise.

I would keep sentence numbers in column A, and sentences in column B.
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
dlmilleCommented:
So, what are you saying.  Do what otherwise?
0
 
dlmilleCommented:
Ah - type in column B and have column a formula?  Then set

[A1] = row() & ": " & B1

or try out the macro I posted.

Enjoy!

Dave

0
 
dlmilleCommented:
ok - let me try again... here's the revised macro for sentence numbers in column A...

Dave
NumberSentenceAuto-r2.xlsm
0
 
patrickabCommented:
JeffBeall,

If you want to keep the list all in one cell then at the end of every line and when you want a new line within that cell use ALT+ENTER. That will insert a new line within the cell. When you have finished editing that cell just press ENTER.

Patrick
0
 
patrickabCommented:
ps. Note: 1900 wasn't a Leap Year
0
 
patrickabCommented:
Oops - Apologies - please ignore that comment it's in the wrong thread.
0
 
JeffBeallAuthor Commented:
thanks for the help.
0
 
patrickabCommented:
JeffBeall - Thanks for the points - Patrick
0
 
dlmilleCommented:
I'm not sure I understand the point distribution, but what the hey...

Dave
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now