PC Review


Reply
Thread Tools Rate Thread

Add an asteric and let user input a number

 
 
Billy
Guest
Posts: n/a
 
      21st Apr 2010
In Excel 2003, i would like to be able to edit cells, specifically, by
adding to the end of a cell entry
an asteric, and then have an Input box for the user to enter a number.
Example, if the active cell's contents were "Apples 5", and the
macro invoked, an input box would appear, and, if the user entered
"3" in the box, the cell contents would now read " Apples 5*3". The
input should be restricted to numbers, such as "3" or "22" or
"2.25" or 0.333, etc.

Thank you very much,

Tonso
 
Reply With Quote
 
 
 
 
Rick Rothstein
Guest
Posts: n/a
 
      21st Apr 2010
Give this macro a try (change the prompt and title in the InputBox to
whatever text you would like them to display)...

Sub AddAsteriskNumber()
Dim Answer As Variant
Answer = Application.InputBox("Number to use?", "Get Number", Type:=1)
If TypeName(Answer) = "Boolean" Then Exit Sub
ActiveCell.Value = ActiveCell.Value & "*" & Answer
End Sub

--
Rick (MVP - Excel)



"Billy" <(E-Mail Removed)> wrote in message
news:e3c53d79-aac1-4c43-bef7-(E-Mail Removed)...
> In Excel 2003, i would like to be able to edit cells, specifically, by
> adding to the end of a cell entry
> an asteric, and then have an Input box for the user to enter a number.
> Example, if the active cell's contents were "Apples 5", and the
> macro invoked, an input box would appear, and, if the user entered
> "3" in the box, the cell contents would now read " Apples 5*3". The
> input should be restricted to numbers, such as "3" or "22" or
> "2.25" or 0.333, etc.
>
> Thank you very much,
>
> Tonso


 
Reply With Quote
 
Billy
Guest
Posts: n/a
 
      21st Apr 2010
On Apr 21, 12:49*pm, "Rick Rothstein"
<rick.newsNO.S...@NO.SPAMverizon.net> wrote:
> Give this macro a try (change the prompt and title in the InputBox to
> whatever text you would like them to display)...
>
> Sub AddAsteriskNumber()
> * Dim Answer As Variant
> * Answer = Application.InputBox("Number to use?", "Get Number", Type:=1)
> * If TypeName(Answer) = "Boolean" Then Exit Sub
> * ActiveCell.Value = ActiveCell.Value & "*" & Answer
> End Sub
>
> --
> Rick (MVP - Excel)
>
> "Billy" <wthoma...@hotmail.com> wrote in message
>
> news:e3c53d79-aac1-4c43-bef7-(E-Mail Removed)...
>
>
>
> > In Excel 2003, i would like to be able to edit cells, specifically, by
> > adding to the end of a cell entry
> > an asteric, and then have an Input box for the user to enter a number.
> > Example, if the active cell's contents were * *"Apples * 5", and the
> > macro invoked, an input box would appear, and, if the user entered
> > "3" in the box, the cell contents would now read " Apples * 5*3". The
> > input should be restricted to numbers, such as * "3" or "22" *or
> > "2.25" or 0.333, etc.

>
> > Thank you very much,

>
> > Tonso- Hide quoted text -

>
> - Show quoted text -


Rick,

Thank you so much! I had no idea how to accomplish this! You made it
look so easy.

Thank again for your expert help!

Tonso
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Requesting user input for a number? StargateFanFromWork Microsoft Excel Programming 3 20th Jun 2006 05:40 PM
User Input Of A Number Chuckles123 Microsoft Excel Programming 1 12th Nov 2004 02:49 AM
User Input Of A Number Chuckles123 Microsoft Excel Programming 1 12th Nov 2004 01:42 AM
User Input Of A Number Chuckles123 Microsoft Excel Programming 0 11th Nov 2004 05:27 AM
User Input Of A Number Chuckles123 Microsoft Excel Programming 2 4th Nov 2004 06:45 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:27 PM.