View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett
 
Posts: n/a
Default Data input in cells

glad to help

--
Don Guillett
SalesAid Software

"Jim May" wrote in message
news:e7kTf.270785$oG.30308@dukeread02...
Great,
Thanks for your input.
Jim

"Don Guillett" wrote in message
...
this should fix all. Use either the delete key or spacebar to start over.

Option Explicit
Dim oldvalue As String

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$A$5" Then
On Error GoTo fixit
Application.EnableEvents = False
If Target = "" Or Target = " " Then
oldvalue = ""
Else
Target.Value = Trim(oldvalue & " " & Target)
oldvalue = Target
End If
fixit:
Application.EnableEvents = True
End If
End Sub

--
Don Guillett
SalesAid Software

"Jim May" wrote in message
news:ZWVSf.250049$oG.87497@dukeread02...
Yeah,
Got it;
Only small glitch.. Currently
the " " is creating leading spaces.
Even when A5 is clear the =len(a5) = 1
This is good stuff (you've done).
TIA,
Jim

"Don Guillett" wrote in message
...
Look at my last post

--
Don Guillett
SalesAid Software

"Jim May" wrote in message
news:SIVSf.250046$oG.219016@dukeread02...
Don:

Can you expand on what this macro is doing?
If i enter in cell A5 This <<and return
then again with A5 the active cell I enter "is a test"
(without the quotes).. I get is a test
From what's being asked it seems the what should
be displayed is This is a test..
Confused, (all too often)..
TIA,



"Don Guillett" wrote in message
...
here is one I have used for numbers modified for text.
right click sheet tabview codeinsert this

Option Explicit
Dim oldvalue As String

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$A$5" Then
On Error GoTo fixit
Application.EnableEvents = False
'If Target.Value = 0 Then oldvalue = 0
'Target.Value = Target.Value & " " & oldvalue
oldvalue = Target.Value
fixit:
Application.EnableEvents = True
End If
End Sub


--
Don Guillett
SalesAid Software

"RichP" wrote in message
...

Hello everyone. We have the requirement to continually input text
into a
cell, and have the ability to keep the existing data already there,
and just
add to it. The problem is once I have data in one cell, leave, and
come back
to add more data, it erases the previous information already within
that
cell. I have tried the Merge cells function and other options within
Excel.
The data we are inputting is more text than numbers. We are using
Excel 2003.

Thanks, Rich