Vba help - might anyone know why i can't get this to function?

usmrncrps

New Member
Joined
Feb 17, 2015
Messages
44
'This script is invoked after the daily percentage rate is calculated by the user

Sub Enter_Click()

'After clicking macro a negative or NO response will return
If MsgBox("HAS PERCENTAGE RATE BEEN VERIFIED??", vbYesNo, "CHOOSE OPTION") = vbNo Then
MsgBox "VERIFY PERCENTAGE RATE BEFORE PROCEEDING", vbCritical, "ERROR"

'After clicking macro a positive response or Yes will return
If MsgBox("HAS PERCENTAGE RATE BEEN VERIFIED??", vbYesNo, "CHOOSE OPTION") = vbYes Then

Dim dt As Date
Range("A2").Value = Date

Dim a As Double

a = Range("B65").Value
b = Range("D65").Value

Dim per As Double
per = (b / a)
Range("C65").Value = per

Dim u As String
Dim i As Integer

i = 0

Do While i < 2190
u = Format(DateAdd("d", i, CDate("1/1/2015")), "mm/dd/yyyy")
i = i + 1
Sheets("Graphs").Range("A" & i = 1) = u

Loop

End If

End Sub
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Maybe ...

Code:
Sub Enter_Click()
  If MsgBox("HAS PERCENTAGE RATE BEEN VERIFIED??", vbYesNo, "CHOOSE OPTION") = vbNo Then
    MsgBox "VERIFY PERCENTAGE RATE BEFORE PROCEEDING", vbCritical, "ERROR"

  Else
    Range("A2").Value = Date
    Range("C65").Value = Range("D65").Value2 / Range("B65").Value2
    With Worksheets("Graph").Range("A1:A2190")
      .Formula = "=""12/31/2014"" + row()"
      .Value = .Value
      .NumberFormat = "mm/dd/yyyy"
  End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,203,051
Messages
6,053,220
Members
444,648
Latest member
sinkuan85

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top