PC Review


Reply
Thread Tools Rate Thread

Creating a Pivot Table with VBA

 
 
=?Utf-8?B?Sm9obiBXaWNrcw==?=
Guest
Posts: n/a
 
      14th Jun 2007
Hello All,

I've been trying to get this Pivot table to work but the formatting escapes
me. All the examples I see have seperate sheets listing duplicate entries in
a long list of items. I'm hoping to use a different approach. What I'd like
to see is a calendar with some drop-downs that a user could select to show
them the available times for say tutors with experience in CISC 310 - C
Programming etc... Or if the user selects a particular tutor show them the
available hours for that particular tutor etc... I know the only way to get
those drop-downs is a pivot table but they don't work with the setup I have.
Just point in the right direction please....

Here's the link on Google where the spread sheet is
http://spreadsheets.google.com/pub?k...M0Q8cDLP8XPBEw

The sheets I'm wanting to use are:
1. Lab Schedule - This is where I'd like the pivot table info to be with a
listing of each tutors name in the time slot. I'd like drop-downs boxes for
class, tutor name and subject. Each would limit the data displayed in the
schedule.
2. Tutor Subject List - Has a sheet with a listing of subjects the tutor is
capable in.
3. Tutor Class List - Similar to above only with classes
4. Tutor Schedule - A Sheet with the available times for the tutor

I've got several named ranges set up and I've created a couple of VB macros
to create lists of the data in those ranges from the sheets.

Examples...

' Gives me a list like John Doe Class1 etc...
Sub ShowTutorClassList()
For Each c In Range("TutorClassX")
If c.Value = "x" Or c.Value = "X" Then
Debug.Print ActiveSheet.Cells(c.Row, 1).Value & " " &
ActiveSheet.Cells(1, c.Column).Value
End If
Next c
End Sub

' Gives me a list like John Doe Subject1
Sub ShowTutorSubjectList()
For Each c In Range("TutorSubjectX")
If c.Value = "x" Or c.Value = "X" Then
Debug.Print ActiveSheet.Cells(c.Row, 1).Value & " " &
ActiveSheet.Cells(1, c.Column).Value
End If
Next c
End Sub

'Gives me a list like John Doe Monday 9:00am-9:30am
Sub ShowTutorScheduleList()
Dim vchName As String
For Each c In Range("TutorScheduleX")
If ((c.Column Mod 2 = 0) And (ActiveSheet.Cells(1, c.Column).Value
<> "")) Then
vchName = ActiveSheet.Cells(1, c.Column).Value
End If
If c.Value = "x" Or c.Value = "X" Then
Debug.Print vchName & " " & ActiveSheet.Cells(2, c.Column).Value
& " " & ActiveSheet.Cells(c.Row, 1).Value; ""
End If
Next c
End Sub

Now I just need to figure out the Pivot table code...

Thanks in advance for any guidance...

John


 
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
How can I detail Pivot Table data without creating a table (Excel2007) Skeletiko Microsoft Excel Misc 1 5th May 2010 08:22 AM
How can I detail Pivot Table data without creating a table (Excel2007) Skeletiko Microsoft Excel Misc 0 5th May 2010 12:21 AM
How can I detail Pivot Table data without creating a table (Excel2007)? Skeletiko Microsoft Excel Discussion 0 15th Apr 2010 11:56 AM
creating a pivot table from 4 pivot tables phyllis W Microsoft Excel Worksheet Functions 0 12th Oct 2008 09:52 PM
Probs with creating multiple pivot charts from pivot table Retreatgal Microsoft Excel Charting 2 28th Jan 2004 02:51 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:26 AM.