NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

function LTA (x as integer) as double
RowVal = 1

you call the LTA or the STA based on what windowSize you give the sub
the windowSize is one of the parameters of the sub
ComputeLSTermAverage(windowSize, dataLength, ....) ToCol
so when you're actually using the sub
that's when you input it
you say
Call ComputeLSTermAverage(LTAsize, ..., ...)
datalength will still be the same - it's just the output from the FindNumberOfDataPoints function
and the writeToCol is which column you need the output
which is column 2 for LTA and column 3 for STA
on the side of the data, it tells you the LTA size and STA size

you just need to put that in as the first parameter you need
you do 2 calls of the sub
Call ComputeLSTermAverage(LTAsize, ..., ...)
Call ComputeLSTermAverage(STAsize, ..., ...)

Function ComputeAverage
1 - FindNumberOfDataPoints function
2 - first and last line
and 3 - a total
average is obviously just the numbers added up divided by how many numbers there are
so you use a while loop, that adds each number to a variable
so it'll look like
total = total + ActiveSheet.Cells(row, col)
and then row = row + 1
and after the while loop is complete, you do average = total / number of data points

In the computeaverage function How do you pick where your data starts and ends
that depends on what parameters you give for firstRow and lastRow
Use the constants at the start of the program
and a loop function
you just use the variables firstRow and lastRow

variable = ComputeAverage(value, value)
I defined a value called I and just said for i = firstrow to lastrow

Row = data_row_start
If ActiveSheet.Cells(row, LTA_COL) <>"" then
ActiveSheet(row, RATIO_COL) = ActiveSheet.Cells(row, STA_COL) / ActiveSheet.Cells(row, LTA_COL)
Row = row + 1
EndIf
while loop
Try a for loop from data row start to whatever ur variable for amount of data points is
With the if statement u have within it
That worked on mine
Stop Sub : Exit Sub
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.