Complex data capture for a report

pillSmith

New Member
Joined
Feb 20, 2012
Messages
2
After watching many youtube videos, I am still stuck on trying to fit the right function/formula into what I am trying to accomplish.

I have many worksheets all linked together and giving me great reports, but the last report I need I can not seem to capture the data I need.

I need a report that will give me the H column (H2:H100) and (A2:A100) with their matching (I1:1FR), which will only return the columns names that have associated numbers (0,1,2,or3)?
A B C H I J
1Sect. Ans Q# Questions Calcium Vitamin B
2Bladder 2 1 Wake hunger? 2 2
3Head 0 2 Consume alcohol?0 0

I can email a screen shoot, if need be.

Please!!! give me some direction to accomplish the right report, or direct me to someone that can help?
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Hi,

Can you post a sample of your data?
thanks.
 
Upvote 0
Hi pillSmith,
sorry but the linked page returns blank...

Try to copy paste here using HTML... it is the < > icon in between the (code)# and the PHP on the right side of all icons.

Cyrilbrd.
 
Upvote 0
Report%20Sample.jpg
Worksheet%20Sample.jpg
 
Upvote 0
Hi
sI asked the help of mikerickson (ozMVP)
he came up with this code:
Code:
Sub test()
    Dim sourceRange As Range
    Dim destinationRange As Range
    Dim relAddress As String, absAddress As String
     
    Set sourceRange = Sheet1.Range("h1").CurrentRegion
    Set destinationRange = Sheet2.Range("a1"): Rem adjust
     
    With sourceRange
        Set destinationRange = destinationRange.Resize(.Rows.Count, .Columns.Count)
    End With
     
    With destinationRange
        .EntireColumn.ClearContents
        relAddress = sourceRange.Cells(1, 1).Address(False, False, xlR1C1, True, .Cells(1, 1))
        absAddress = sourceRange.Cells(1, 1).Address(True, False, xlR1C1, True, .Cells(1, 1))
        .FormulaR1C1 = "=IF(" & relAddress & ">0," & absAddress & ")"
        .Value = .Value
        .Rows(1).Value = sourceRange.Rows(1).Value
        .Columns(1).Value = sourceRange.Columns(1).Value
        On Error Resume Next
        .SpecialCells(xlCellTypeConstants, xlLogical).Delete shift:=xlToLeft
        On Error GoTo 0
    End With
     
    Set destinationRange = destinationRange.Cells(1, 1).CurrentRegion
     
    With destinationRange
        .Rows(1).Delete shift:=xlUp
        On Error Resume Next
        With Application.Intersect(.Cells, .Columns(2).SpecialCells(xlCellTypeBlanks).EntireRow)
            .Delete shift:=xlUp
        End With
        On Error GoTo 0
    End With
End Sub
Now i just changed the range so it returns the feedback on sheet2 starting cell A1.
it works with the following conditions:
in sheet 1
HTML:
sections	Q?	calcium	VitB	castrol packs	VitA
Q#1	Q#1			6	8
Q#2	Q#2	0		0	
Q#3	Q#3		1	0	0
Q#4	Q#4		4		5
Q#5	Q#5	4		1

gives in sheet 2:
HTML:
Q#1	castrol packs	VitA
Q#3	VitB	
Q#4	VitB	VitA
Q#5	calcium	castrol packs

I am confident that someone more competent will help you change this to fit your needs.
It worked fine on my excel14.1.4

Cheers.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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