2

I am a VBA Newbie and a first timer on this forum - I have followed all the instructions on the "how to ask" page - I may have missed something please do advise

I am creating an EV report for project tracking based on the following column headers (showing only a few for brevity)

"TaskName" "Status" "BaselineStart" "BaselineFinish" "BaselineEffort"

need to sum up the values in the BaselineEffort column in 7 day increments after checking if the value in the BaselineFinish column is less than or equal to the 7th day value

I believe the answer lies in using arrays, but need handholding with that concept to understand how it works

Pivot and Excel formulas dont work for me because the table is dynamic while the report is static and I need to remove user intervention in creating the report

Thanks in advance

Community
  • 1
  • 1
Simon
  • 21
  • 1
  • 2

1 Answers1

0

say that the criteria column starts in A1 and the colume to be summed starts in B1

do while not isempty(range("a1").offset(x,0))
  if range("a1").offset(x,0) = SomeValue then
    sum = sum + range("a1").offset(x,0)
  end if
  x = x + 1
loop

this code will run until it has looked at each item in column A, and add the value in column B to a sum I called "sum" if the value in column A equals "SomeValue." I doubt you can actually use the variable name "sum."

I hope that's useful.

user2200765
  • 21
  • 1
  • 1
  • 5