This is probably an easy question for someone who is familiar with VBA, but as a newbie, I am totally coming up empty.
I've got two sheets, one is the raw data that I am already using code to pull from Project with no issues. The other is the output sheet. On the Sheet with the data, I've got 3 columns (A, E, and H). Column A has a list of tasks, column E has a description, and column H has a Fiscal Year and Quarter.
On the output page, I have 10 years worth of fiscal years.
What I'm looking to do is scan the tasks for a certain type of task, then once I find that task, I output the description information in the correct corresponding fiscal year.
I feel like it will need to be a combination of a DO Loop and an If Then, but what I was trying was not working. Below is what I started with and knew pretty quickly that it wouldn't work.
Do Until Worksheets("Project Data").Range("A1").Offset(Row, 0).Value = Empty
If Worksheets("Project Data").Range("A1").Value = "Task example*" Then
If Worksheets("Project Data").Range("H1") = "FY15*" Then
If Worksheets("Project Data").Range("E1") = "" Then Worksheets("Output").Range("C5") = 1
ElseIf Worksheets("Project Data").Range("E1") = "description 1*" Then Worksheets("Output").Range("C5") = 2
ElseIf Worksheets("Project Data").Range("E1") = "description 2*" Then Worksheets("Output").Range("C5") = 3
End If
If Worksheets("Project Data").Range("H1") = "FY16*" Then
If Worksheets("Project Data").Range("E1") = "" Then Worksheets("Output").Range("C6") = 1
ElseIf Worksheets("Project Data").Range("E1") = "description 1*" Then Worksheets("Output").Range("C6") = 2
ElseIf Worksheets("Project Data").Range("E1") = "description 2*" Then Worksheets("Output").Range("C6") = 3
End If
Loop
As I said, this was not working for multiple reasons. Any help would be greatly appreciated! Thanks in advance!
Edit: Adding some dummy data. Can't figure out how to add an attachment and don't have a rating to add an image so I've got lists below, hopefully that works. Sorry, this is ugly!
Raw data
- Column A (task) / Column E (description) / Column H (FYQ)
- Example / A / FY15Q4
- Meeting / blank / FY17Q1
- Testing / blank / FY16Q3
- Example / B / FY15Q3
- Example / B / FY16Q1
- Meeting / blank / FY15Q2
- Testing / blank / FY16Q3
- Example / C / FY16Q2
Output data
- FY15 / A / B
- FY16 / B / C
May be up to 6 on each fiscal year line