precentage cell

  • Thread starter Thread starter jazib iqbal
  • Start date Start date
J

jazib iqbal

Hi
i have one questions. i try insert value in to the
precentage cells with vba but something wrong, if i insert
nr 5 this change to the 500%


code:
-----------------------------------------------------------
---------------------

Dim iReply As Integer
Dim rListPaste As String
On Error Resume Next
st:
rListPaste = Application.InputBox("enter %")

If rListPaste = "" Then
iReply = MsgBox("emty," _
& " terminate?", vbYesNo + vbQuestion)

If iReply = vbYes Then Exit Sub

If iReply = vbNo Then
GoTo st
End If
End If
rng = rListPaste
 
Hi
100% is equal to 1
so 5% is equal to 0.05

in your example change the line
rng = rListPaste
to rng = rListPaste/100
 

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

Back
Top