Need complex vba help!

ngann

New Member
Joined
Jan 18, 2018
Messages
21
I am trying to create a tracking system for the data below. The macro will run in the first tab and track the data from the second tab. I need the macro to match the sections then look up the date from the first tab and determine which date range it falls into on the second tab. Once it has found the date range I need it to determine if the "Actual date complete" column is also within that range. If it is blank aka not complete, then return a value of how many days it is behind. This would go into the "Schedule" column for the corresponding section. Then for cost it would do the same lookup method to determine which range we should be in then compare the sum of "Actual $ Spent" until that date to the "Running Total (Budget)". I know this is very confusing :(

[TABLE="width: 659"]
<tbody>[TR]
[TD="width: 238, bgcolor: black"][/TD]
[TD="width: 128, bgcolor: transparent, colspan: 2"]3/6/2019[/TD]
[TD="width: 128, bgcolor: transparent, colspan: 2"]3/14/2019[/TD]
[TD="width: 128, bgcolor: transparent, colspan: 2"]3/21/2019[/TD]
[TD="width: 128, bgcolor: transparent, colspan: 2"]3/28/2019[/TD]
[TD="width: 128, bgcolor: transparent, colspan: 2"]4/4/2019[/TD]
[/TR]
[TR]
[TD="width: 238, bgcolor: transparent"]Section[/TD]
[TD="bgcolor: transparent"]Cost[/TD]
[TD="bgcolor: transparent"]Schedule[/TD]
[TD="bgcolor: transparent"]Cost[/TD]
[TD="bgcolor: transparent"]Schedule[/TD]
[TD="bgcolor: transparent"]Cost[/TD]
[TD="bgcolor: transparent"]Schedule[/TD]
[TD="bgcolor: transparent"]Cost[/TD]
[TD="bgcolor: transparent"]Schedule[/TD]
[TD="bgcolor: transparent"]Cost[/TD]
[TD="bgcolor: transparent"]Schedule[/TD]
[/TR]
[TR]
[TD="width: 238, bgcolor: #D9D9D9"]1[/TD]
[TD="bgcolor: #D9D9D9"][/TD]
[TD="bgcolor: #D9D9D9"][/TD]
[TD="bgcolor: #D9D9D9"][/TD]
[TD="bgcolor: #D9D9D9"][/TD]
[TD="bgcolor: #D9D9D9"][/TD]
[TD="bgcolor: #D9D9D9"][/TD]
[TD="bgcolor: #D9D9D9"][/TD]
[TD="bgcolor: #D9D9D9"][/TD]
[TD="bgcolor: #D9D9D9"][/TD]
[TD="bgcolor: #D9D9D9"][/TD]
[/TR]
[TR]
[TD="width: 238, bgcolor: white"]2[/TD]
[TD="bgcolor: white"][/TD]
[TD="bgcolor: white"][/TD]
[TD="bgcolor: white"][/TD]
[TD="bgcolor: white"][/TD]
[TD="bgcolor: white"][/TD]
[TD="bgcolor: white"][/TD]
[TD="bgcolor: white"][/TD]
[TD="bgcolor: white"][/TD]
[TD="bgcolor: white"][/TD]
[TD="bgcolor: white"][/TD]
[/TR]
[TR]
[TD="width: 238, bgcolor: #D9D9D9"]3[/TD]
[TD="bgcolor: #D9D9D9"][/TD]
[TD="bgcolor: #D9D9D9"][/TD]
[TD="bgcolor: #D9D9D9"][/TD]
[TD="bgcolor: #D9D9D9"][/TD]
[TD="bgcolor: #D9D9D9"][/TD]
[TD="bgcolor: #D9D9D9"][/TD]
[TD="bgcolor: #D9D9D9"][/TD]
[TD="bgcolor: #D9D9D9"][/TD]
[TD="bgcolor: #D9D9D9"][/TD]
[TD="bgcolor: #D9D9D9"]

[/TD]
[/TR]
</tbody>[/TABLE]

[TABLE="width: 570"]
<tbody>[TR]
[TD="width: 235, bgcolor: transparent"]Section
[/TD]
[TD="width: 118, bgcolor: white"]Section Start Date[/TD]
[TD="width: 112, bgcolor: white"]Section End Date[/TD]
[TD="width: 68, bgcolor: #D9D9D9"]Actual Date Complete[/TD]
[TD="width: 64, bgcolor: #D9D9D9"] Actual $ Spent [/TD]
[TD="width: 81, bgcolor: #D9D9D9"] Budget [/TD]
[TD="width: 81, bgcolor: #D9D9D9"] Running Total (Budget) [/TD]
[/TR]
[TR]
[TD="width: 235, bgcolor: white"]3
[/TD]
[TD="width: 118, bgcolor: white"]4/5/2019[/TD]
[TD="width: 112, bgcolor: white"]4/8/2019[/TD]
[TD="width: 68, bgcolor: transparent, align: right"]4/7/2019[/TD]
[TD="width: 64, bgcolor: transparent"] $ 9.00 [/TD]
[TD="width: 81, bgcolor: transparent"] $ 10.00 [/TD]
[TD="width: 81, bgcolor: transparent"] $ 10.00 [/TD]
[/TR]
[TR]
[TD="width: 235, bgcolor: white"]3.8.1 Transmission Performance
[/TD]
[TD="width: 118, bgcolor: white"]4/9/2019[/TD]
[TD="width: 112, bgcolor: white"]4/14/2019[/TD]
[TD="width: 68, bgcolor: transparent, align: right"]4/8/2019[/TD]
[TD="width: 64, bgcolor: transparent"] $ 10.00 [/TD]
[TD="width: 81, bgcolor: transparent"] $ 10.00 [/TD]
[TD="width: 81, bgcolor: transparent"] $ 20.00 [/TD]
[/TR]
[TR]
[TD="width: 235, bgcolor: white"]3.8.1 Transmission Performance
[/TD]
[TD="width: 118, bgcolor: white"]4/13/2019[/TD]
[TD="width: 112, bgcolor: white"]4/20/2019[/TD]
[TD="width: 68, bgcolor: transparent, align: right"]4/17/2019[/TD]
[TD="width: 64, bgcolor: transparent"] $ 15.00 [/TD]
[TD="width: 81, bgcolor: transparent"] $ 15.00 [/TD]
[TD="width: 81, bgcolor: transparent"] $ 35.00 [/TD]
[/TR]
[TR]
[TD="width: 235, bgcolor: white"]3.8.1 Transmission Performance
[/TD]
[TD="width: 118, bgcolor: white"]4/17/2019[/TD]
[TD="width: 112, bgcolor: white"]4/26/2019[/TD]
[TD="width: 68, bgcolor: transparent"][/TD]
[TD="width: 64, bgcolor: transparent"] $ - [/TD]
[TD="width: 81, bgcolor: transparent"] $ 20.00 [/TD]
[TD="width: 81, bgcolor: transparent"] $ 55.00 [/TD]
[/TR]
[TR]
[TD="width: 235, bgcolor: white"]3.8.1 Transmission Performance[/TD]
[TD="width: 118, bgcolor: white"]4/21/2019[/TD]
[TD="width: 112, bgcolor: white"]5/2/2019[/TD]
[TD="width: 68, bgcolor: transparent"][/TD]
[TD="width: 64, bgcolor: transparent"] $ - [/TD]
[TD="width: 81, bgcolor: transparent"] $ 25.00 [/TD]
[TD="width: 81, bgcolor: transparent"] $ 80.00 [/TD]
[/TR]
[TR]
[TD="width: 235, bgcolor: white"]3.8.1 Transmission Performance[/TD]
[TD="width: 118, bgcolor: white"]4/25/2019[/TD]
[TD="width: 112, bgcolor: white"]5/8/2019[/TD]
[TD="width: 68, bgcolor: transparent"][/TD]
[TD="width: 64, bgcolor: transparent"] $ - [/TD]
[TD="width: 81, bgcolor: transparent"] $ 30.00 [/TD]
[TD="width: 81, bgcolor: transparent"] $ 110.00 [/TD]
[/TR]
[TR]
[TD="width: 235, bgcolor: white"]3.8.1 Transmission Performance
[/TD]
[TD="width: 118, bgcolor: white"]4/29/2019[/TD]
[TD="width: 112, bgcolor: white"]5/14/2019[/TD]
[TD="width: 68, bgcolor: transparent"][/TD]
[TD="width: 64, bgcolor: transparent"] $ - [/TD]
[TD="width: 81, bgcolor: transparent"] $ 40.00 [/TD]
[TD="width: 81, bgcolor: transparent"] $ 150.00 [/TD]
[/TR]
[TR]
[TD="width: 235, bgcolor: white"]3.8.1 Transmission Performance[/TD]
[TD="width: 118, bgcolor: white"]5/3/2019[/TD]
[TD="width: 112, bgcolor: white"]5/20/2019[/TD]
[TD="width: 68, bgcolor: transparent"][/TD]
[TD="width: 64, bgcolor: transparent"] $ - [/TD]
[TD="width: 81, bgcolor: transparent"] $ 45.00 [/TD]
[TD="width: 81, bgcolor: transparent"] $ 195.00 [/TD]
[/TR]
[TR]
[TD="width: 235, bgcolor: white"][/TD]
[TD="width: 118, bgcolor: white"]5/7/2019[/TD]
[TD="width: 112, bgcolor: white"]5/26/2019[/TD]
[TD="width: 68, bgcolor: transparent"][/TD]
[TD="width: 64, bgcolor: transparent"] $ 34.00 [/TD]
[TD="width: 81, bgcolor: transparent"] $ 50.00 [/TD]
[TD="width: 81, bgcolor: transparent"] $ 145.00 [/TD]
[/TR]
[TR]
[TD="width: 235, bgcolor: transparent"]2[/TD]
[TD="width: 118, bgcolor: white"]3/1/2019[/TD]
[TD="width: 112, bgcolor: white"]3/4/2019[/TD]
[TD="width: 68, bgcolor: transparent, align: right"]3/3/2019[/TD]
[TD="width: 64, bgcolor: transparent"] $ 9.00 [/TD]
[TD="width: 81, bgcolor: transparent"] $ 10.00 [/TD]
[TD="width: 81, bgcolor: transparent"] $ 10.00 [/TD]
[/TR]
[TR]
[TD="width: 235, bgcolor: transparent"]3.8.2.3 Thermal Power and Flow Definition[/TD]
[TD="width: 118, bgcolor: white"]3/5/2019[/TD]
[TD="width: 112, bgcolor: white"]3/8/2019[/TD]
[TD="width: 68, bgcolor: transparent, align: right"]3/7/2019[/TD]
[TD="width: 64, bgcolor: transparent"] $ 10.00 [/TD]
[TD="width: 81, bgcolor: transparent"] $ 10.00 [/TD]
[TD="width: 81, bgcolor: transparent"] $ 20.00 [/TD]
[/TR]
[TR]
[TD="width: 235, bgcolor: transparent"]3.8.2.3 Thermal Power and Flow Definition[/TD]
[TD="width: 118, bgcolor: white"]3/9/2019[/TD]
[TD="width: 112, bgcolor: white"]3/12/2019[/TD]
[TD="width: 68, bgcolor: transparent, align: right"]3/11/2019[/TD]
[TD="width: 64, bgcolor: transparent"] $ 15.00 [/TD]
[TD="width: 81, bgcolor: transparent"] $ 15.00 [/TD]
[TD="width: 81, bgcolor: transparent"] $ 35.00 [/TD]
[/TR]
[TR]
[TD="width: 235, bgcolor: transparent"]3.8.2.3 Thermal Power and Flow Definition[/TD]
[TD="width: 118, bgcolor: white"]3/13/2019[/TD]
[TD="width: 112, bgcolor: white"]3/16/2019[/TD]
[TD="width: 68, bgcolor: transparent"][/TD]
[TD="width: 64, bgcolor: transparent"] $ - [/TD]
[TD="width: 81, bgcolor: transparent"] $ 20.00 [/TD]
[TD="width: 81, bgcolor: transparent"] $ 55.00 [/TD]
[/TR]
[TR]
[TD="width: 235, bgcolor: transparent"]3.8.2.3 Thermal Power and Flow Definition
[/TD]
[TD="width: 118, bgcolor: white"]3/17/2019[/TD]
[TD="width: 112, bgcolor: white"]3/20/2019[/TD]
[TD="width: 68, bgcolor: transparent"][/TD]
[TD="width: 64, bgcolor: transparent"] $ - [/TD]
[TD="width: 81, bgcolor: transparent"] $ 25.00 [/TD]
[TD="width: 81, bgcolor: transparent"] $ 80.00 [/TD]
[/TR]
[TR]
[TD="width: 235, bgcolor: transparent"]3.8.2.3 Thermal Power and Flow Definition[/TD]
[TD="width: 118, bgcolor: white"]3/21/2019
[/TD]
[TD="width: 112, bgcolor: white"]3/24/2019
[/TD]
[TD="width: 68, bgcolor: transparent"][/TD]
[TD="width: 64, bgcolor: transparent"] $ - [/TD]
[TD="width: 81, bgcolor: transparent"] $ 30.00 [/TD]
[TD="width: 81, bgcolor: transparent"] $ 110.00 [/TD]
[/TR]
[TR]
[TD="width: 235, bgcolor: transparent"][/TD]
[TD="width: 118, bgcolor: white"]3/25/2019[/TD]
[TD="width: 112, bgcolor: white"]3/28/2019[/TD]
[TD="width: 68, bgcolor: transparent"][/TD]
[TD="width: 64, bgcolor: transparent"] $ 34.00 [/TD]
[TD="width: 81, bgcolor: transparent"] $ 40.00
[/TD]
[TD="width: 81, bgcolor: transparent"] $ 150.00
[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited by a moderator:

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

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