Hi I saw this post, http://www.ozgrid.com/forum/showthread.php?t=190548 and I am using some of the same code however, I need a little help in customizing it. I am using the code to pull the data into a summary page and that works but I am trying to break it into titles. Thanks for your help in advance. I am still really new to vba.
I have 2 sheets within a work book. The first sheet we will call assessment. In this sheet it has multiple rows of questions (approx. 422 rows of questions). The questions are in the "C" column. On the same row in columns AD (yes) and AG (no) is where the assessor will mark the box with an X as the result. The questions are broken into 7 groups with Titles( example would be Prepare Resources and Mobilize Resources). See below. On the second sheet I call it summary. Which I want to pull the title of the section and the questions from that section in column "B" IF the cell AG (no) contains an X. I want to be able to create a summary page to hand to the manager that contains the title of the section and what questions were marked as no in that section.
[TABLE="class: cms_table_cms_table_grid, width: 500"]
Row 12
Col. C
Col. AD (Yes)
Col. AG (No)
15
Prepare Resources
16
Question asked 1
X
17
Question asked 2
X
18
Question asked 3
X
25
Mobilize Resources
26
Question asked 4
X
27
Question asked 5
X
28
Question asked 6
X
[/TABLE]
The summary page I would like to look like this with only if questions were marked with a x in the AG(no) column.
[TABLE="class: cms_table_cms_table_grid, width: 500"]
Prepare Resources
Question asked 1
Question asked 3
Mobilize Resources
Question asked 4
Question asked 6
[/TABLE]
I am getting closer. I am able to pull the data into the sheet. I am still struggling on how to separate it. I am curious can I set up multiple subs (one for prepare resources, one for mobilize)and create a range with in it to separate into different titles?
Sub PrepareResources()
Dim WSsrc As Worksheet
Dim WSDest As Worksheet
Dim LRSrc As Long
Dim LRDest As Long
Dim AG As Long
Set WSsrc = Worksheets("Assessment")
Set WSDest = Worksheets("Summary")
With WSDest
LRDest = .Cells(.Rows.Count, "E").End(xlUp).Row + 1
.Range("E2:E" & LRDest).Clear
LRDest = 2
End With
With WSsrc
LRSrc = .Cells(.Rows.Count, "B").End(xlUp).Row
For AG = 15 To LRSrc
If UCase(.Range("AG" & AG)) = "X" Then
WSDest.Range("E" & LRDest) = .Range("B" & AG)
LRDest = LRDest + 1
End If
Next
End With
End Sub
Display More