Dear Forum Members,
I am having trouble getting this code to run. Apparently, the StDev function cannot be called. Any help on the syntax will be greatly appreciated.
ChrisSub DoCalcualtions(ByRef rForm As Long, ByRef lngBeginRange As Long, ByRef lngEndRange As Long, ByVal intLastCol As Integer) Dim c As Integer ' FormHeader rForm, intLastCol ' For c = 3 To intLastCol Worksheets("Form").Cells(rForm + 1, c) = Worksheets("Data").Application.WorksheetFunction.StDev(Range(Cells(lngBeginRange, c), Cells(lngEndRange, c))) Next c ' rForm = rForm + 7 End Sub
Try the simpler...
orWorksheets("Form").Cells(rForm + 1, c) = WorksheetFunction.StDev(Range(Cells(lngBeginRange, c), Cells(lngEndRange, c)))
Worksheets("Form").Cells(rForm + 1, c) = WorksheetFunction.StDev(Range(Cells(lngBeginRange, c).Value , Cells(lngEndRange, c).Value))
Martin
Eighty Twenty Spreadsheet Automation http://homepage.ntlworld.com/martin.rice1/ for all your Excel customisation and consulting needs.
If my solution has saved you time and/or money, please consider donating to Cancer Research UK.
Dear Martin,
I have been staring at this screen for hours, making minor adjustments but could not get it right! I copied your code (the first one) into the macro and it ran perfectly! Thank you so much - this is a big break for me.
Chris
[SOLVED]
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks