create a prompt box to perform a function?

C

Cathy

I am trying to have a prompt that comes out that allows users to change a row
of numbers but a percentage that they want or a colum. Meaning right now I
have e-k with rates in it. They want to be able to change the rates without
having to go in on a daily basis and calcuate each rate seperately and then
enter that new rate on the sheet. They want to be prompted to say this row
change by +/- a given percentage. I can not figure out how to get excel to
do this.

I have working on this for days and have come up with no easy solution at
all.

Please help me!

Cathy
 
B

Bob Phillips

Cathy,

Does this help?

Private Sub Worksheet_selectionChange(ByVal Target As Range)
Dim nRate
Dim cell As Range

On Error GoTo ws_exit:
Application.EnableEvents = False
If Target.Column = 1 Then
With Target
nRate = InputBox("Supply rate")
If nRate <> "" Then
If IsNumeric(nRate) Then
For Each cell In Me.Range("E" & .Row).Resize(1,
Me.Cells(.Row, Columns.Count).End(xlToLeft).Column - 4)
cell.Value = cell.Value * (1 + nRate)
Next cell
End If
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.




--

HTH

RP
(remove nothere from the email address if mailing direct)
 
O

Otto Moehrbach

Cathy
I think what you are looking for is an InputBox or an entry cell.
Either way would cause Excel to react to do whatever you want it to do.
There are several ways to do what you want
Is this what you have in mind? If you
wish, send me, direct, a small file with a sample of what you have to start
and a sample of what you want to happen, and I'll work up something you can
work with. If you feel your data is proprietary, just make up something.
My email address is (e-mail address removed). Remove the "Cobia97 from
this address. Include the version of Excel you are using. HTH Otto
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top