Results 1 to 5 of 5

Compile Error in VBA Code

Threaded View

  1. #1
    Forum Contributor
    Join Date
    02-08-2005
    MS-Off Ver
    Microsoft 365
    Posts
    839

    Compile Error in VBA Code

    Hi,

    I am trying to teach myself how to use VBA and, to that end, I wish to write some code to calculate the standard deviation of a range of data to be selected by the user.

    Unfortunately I have stumbled at the first hurdle, receiving a Compile Error when trying to execute the code. Can someone please tell me what is wrong:
    Sub Volatility()
        Dim Volatility As Double
        Set Volatility = Application.InputBox("Enter Data Range", Type:=8)
        MsgBox WorksheetFunction.StDev(Volatility)
           
    End Sub
    Thanks!
    Last edited by romperstomper; 06-22-2011 at 08:13 AM. Reason: code tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1