Thread: Input text
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Input text

Try something like the following:

Sub AAA()
Dim S As String
Dim Rng As Range
S = InputBox("Enter a value.")
If StrPtr(S) = 0 Then
' user hit cancel
Exit Sub
Else
For Each Rng In Selection.Cells
Rng.Value = S & Rng.Text
Next Rng
End If
End Sub

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"ali" wrote in message
...

Can anyone help me please, i'm having difficulty solving

this...

I want to create a macro that will allow the user to input text

of
their choosing into a cell that already contains numbers,

ie I have a column full of product codes and i want to be able

to
select the cells and run a macro which will bring up a box that

will
allow the user to enter the text of their choosing and when

they click
ok will insert their text before the current numbers in each of

the
selected cells.

Any help would be much appreciated


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

http://www.ExcelForum.com/