PC Review


Reply
Thread Tools Rate Thread

Array Report

 
 
Greg Collins
Guest
Posts: n/a
 
      9th Sep 2007
Hi. I am trying to build the following type of data and report...

In sheet1 I want to have an array where I have labels across row 1 and down
column a. Then in the associated fields, I will place an X if there is a
match.

So for example, across is fields of expertese (Doctor, Nurse, Dentist,
Surgeon, etc). Down is last names (Adams, Bennett, Carrey, Davis, etc). If
Bennett is a Nurse, I place an X in C3. If Davis is a Surgeon, I place an X
in E5.

Make sense so far? This part is simple. Just data entry.

Now I want to have sheet2 that is a report on the values in sheet1. I want
to keep the same across headers (Doctor, etc) and then just list the last
name labels under each expertese header only where there is an associated X.

So for example, under the label Nurse, I would see Bennett. And under the
label Surgeon, I would see Davis.

How do I make this happen?

--
Greg Collins
Microsoft MVP
Visit Braintrove at http://www.braintrove.com



 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      9th Sep 2007
Is there a reason you can't keep all you data on that single worksheet and use
data|filter|autofilter to show/hide the rows according to what you want.

It makes life a lot easier if there's only one version of the data.

Greg Collins wrote:
>
> Hi. I am trying to build the following type of data and report...
>
> In sheet1 I want to have an array where I have labels across row 1 and down
> column a. Then in the associated fields, I will place an X if there is a
> match.
>
> So for example, across is fields of expertese (Doctor, Nurse, Dentist,
> Surgeon, etc). Down is last names (Adams, Bennett, Carrey, Davis, etc). If
> Bennett is a Nurse, I place an X in C3. If Davis is a Surgeon, I place an X
> in E5.
>
> Make sense so far? This part is simple. Just data entry.
>
> Now I want to have sheet2 that is a report on the values in sheet1. I want
> to keep the same across headers (Doctor, etc) and then just list the last
> name labels under each expertese header only where there is an associated X.
>
> So for example, under the label Nurse, I would see Bennett. And under the
> label Surgeon, I would see Davis.
>
> How do I make this happen?
>
> --
> Greg Collins
> Microsoft MVP
> Visit Braintrove at http://www.braintrove.com


--

Dave Peterson
 
Reply With Quote
 
Greg Collins
Guest
Posts: n/a
 
      10th Sep 2007
What I need to make is a printable report... so for each area of expertese,
I need a list of names below it.

The report can't just be a grid with a set of X's... yet that's the easiest
way of data entry for the person who will be entering the data.

--
Greg Collins
Microsoft MVP
Visit Braintrove at http://www.braintrove.com

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      10th Sep 2007
Copy the existing sheet to a new sheet (protect the original).

On that new sheet
Convert all the formulas to values (if required)
Select the data portion of your table (don't include the row or column headers)
Edit|Goto|special|constants
(notice that only the X's are selected)
Type this:
=$a#
where # is the number of the row that holds that active cell
but hit ctrl-enter instead of just enter.
Now all the X's have turned to the names in column A

Select all the cells in the table
edit|copy
edit|Paste special|values

(almost done)

Edit|goto|special|blanks
(all the empty cells are now selected)

Edit|delete|shift cells up

Delete the first column if you want.
Delete any empty columns if no one matched that category (if you want)




Greg Collins wrote:
>
> What I need to make is a printable report... so for each area of expertese,
> I need a list of names below it.
>
> The report can't just be a grid with a set of X's... yet that's the easiest
> way of data entry for the person who will be entering the data.
>
> --
> Greg Collins
> Microsoft MVP
> Visit Braintrove at http://www.braintrove.com


--

Dave Peterson
 
Reply With Quote
 
Greg Collins
Guest
Posts: n/a
 
      11th Sep 2007
That's a good manual solution.

Seems like Excel should be powerful enough to have this more automated.

Maybe I'm just expecting too much from Excel. )

--
Greg Collins
Microsoft MVP
Visit Braintrove at http://www.braintrove.com

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      12th Sep 2007
Record a macro when you do this manually????

I modified my recorded code and got this:

Option Explicit
Sub testme01()

Dim OldWks As Worksheet
Dim NewWks As Worksheet
Dim LastRow As Long
Dim LastCol As Long
Dim iCol As Long
Dim Rng As Range

Set OldWks = Worksheets("sheet1")
OldWks.Copy _
after:=OldWks

Set NewWks = ActiveSheet

With NewWks
With .UsedRange
.Copy
.PasteSpecial Paste:=xlPasteValues
End With

LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
LastCol = .Cells(1, .Columns.Count).End(xlToLeft).Column

Set Rng = Nothing
On Error Resume Next
Set Rng = .Range("B2", .Cells(LastRow, LastCol)) _
.Cells.SpecialCells(xlCellTypeConstants)
On Error GoTo 0

If Rng Is Nothing Then
MsgBox "nothing to fix!"
Exit Sub
End If

Rng.FormulaR1C1 = "=rc1"

With .UsedRange
.Copy
.PasteSpecial Paste:=xlPasteValues
End With

Set Rng = Nothing
On Error Resume Next
Set Rng = .Range("b2", .Cells(LastRow, LastCol)) _
.Cells.SpecialCells(xlCellTypeBlanks)
On Error GoTo 0

If Rng Is Nothing Then
'no rows to squish
Else
Rng.Delete shift:=xlShiftUp
End If

For iCol = LastCol To 2 Step -1
If Application.CountA(.Range(.Cells(2, iCol), _
.Cells(LastRow, iCol))) = 0 Then
.Columns(iCol).Delete
End If
Next iCol

.Columns(1).Delete

End With

End Sub

Greg Collins wrote:
>
> That's a good manual solution.
>
> Seems like Excel should be powerful enough to have this more automated.
>
> Maybe I'm just expecting too much from Excel. )
>
> --
> Greg Collins
> Microsoft MVP
> Visit Braintrove at http://www.braintrove.com


--

Dave Peterson
 
Reply With Quote
 
Greg Collins
Guest
Posts: n/a
 
      14th Sep 2007
Thanks for all your support.

--
Greg Collins
Microsoft MVP
Visit Braintrove at http://www.braintrove.com
Visit InfoPathDev at http://www.infopathdev.com




 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
array type report Ericnz Microsoft Access VBA Modules 3 8th May 2009 04:40 PM
Array data to a report =?Utf-8?B?VUtNQU4=?= Microsoft Excel Worksheet Functions 4 20th Sep 2007 08:22 AM
Report to Array via VB need help!! =?Utf-8?B?VGhlR2VybWFu?= Microsoft Access Reports 3 23rd May 2005 04:20 AM
Creating Import Report - Array? Steven Britton via AccessMonster.com Microsoft Access VBA Modules 2 12th Apr 2005 05:15 PM
Re: Array Report SA Microsoft Access Reports 0 7th May 2004 01:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:38 PM.