Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default User input in cell

crispbd showed you how to enter a value, then return to the cell and double
click on it to convert the entry to a calculated entry and leaves you in
edit mode. If that is what you want, your set.

I would interpret your request differently. I understood you to say that if
I entered a value, such as 100, then when I hit enter, that entry would be
changed to =2*100+.99

If so, you would follow crispbd's instructions but instead of the
beforedoubleclick event, you would select the Change event. The code would
look like this

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count 1 Then Exit Sub
If IsEmpty(Target) Then Exit Sub
If Not IsNumeric(Target) Then Exit Sub
If Target.HasFormula Then Exit Sub
On Error GoTo ErrHandler
Application.EnableEvents = False
Target.Formula = "=2*" & Target.Value & "+0.99"
ErrHandler:
Application.EnableEvents = True
End Sub


If you only want this to occur for a specific column, you could add a line
like

' Only behave this way for column C
if Target.Column < 3 then exit sub

--
Regards,
Tom Ogilvy


"Sean" wrote in message
...
Hi,
How do formulate or set up a cell to take the users info that they enter

in
that cell and immediately calculate an answer based on their entry and

then
show the answer in that exact cell?
eg. a cell is designated as a cost of an item, but what we want to show

in
that cell isnt what they enter, but rather 2 X the cost +.99. is there

any
way of doing this without having to use another cell?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Code to have User input data for cell Bean Counter[_2_] Excel Discussion (Misc queries) 0 May 27th 10 09:56 PM
refilling data in same cell after user input in another cell H. Singh Excel Discussion (Misc queries) 7 April 24th 07 12:48 PM
Have user input converted to uppercase in same cell as input? Shannonn New Users to Excel 1 June 20th 06 03:19 AM
Changing Cell Contents Based Upon User Input BigCheese Excel Programming 1 June 23rd 04 07:09 PM


All times are GMT +1. The time now is 10:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"