LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Macro to Count how many recordsbetween each hour interval?

When you put quotes around things, it's just text, not a variable. Instead
of

SourceData:="!MyData"
try
SourceData:=MyData

I'm walking you through this project and you ask me to be nice ? Next week
I'll be nice.

Best wishes Harald

"nbaj2k" skrev i
melding ...

I'm just learning this so be nice lol

This is not vaild code?

I tried to implement MyData, but wanted the Pivot Table to include the
current region of cell D3. I wanted to do this because there may be a
lot of records, and might not be.

It gives me an error saying "Reference not valid" so I assume I'm
writing this wrong.

Thanks,

~J

Dim MyData As Range
Set MyData = Sheets("Visible").Range("D3").CurrentRegion

Range("D3").Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:=
_
"!MyData").CreatePivotTable TableDestination:="", TableName:=
_
"PivotTable1", DefaultVersion:=xlPivotTableVersion10
ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3,
1)
ActiveSheet.Cells(3, 1).Select
ActiveSheet.PivotTables("PivotTable1").AddFields
RowFields:="created"

ActiveSheet.PivotTables("PivotTable1").PivotFields ("created").Orientation
= _
xlDataField
Range("A4").Select
Selection.Group Start:=True, End:=True, Periods:=Array(False,
False, True, _
False, False, False, False)


--
nbaj2k
------------------------------------------------------------------------
nbaj2k's Profile:

http://www.excelforum.com/member.php...o&userid=36480
View this thread: http://www.excelforum.com/showthread...hreadid=562821



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
help needed with excel, need to count the number ofpeople here each hour. Simon Wells Excel Worksheet Functions 1 October 13th 08 09:40 PM
How to use count for calls per hour kg New Users to Excel 1 September 20th 08 03:56 PM
Hour Count EliA Excel Worksheet Functions 4 June 25th 08 10:17 PM
How to count hours- and multiply with my wage per hour... Sofus Excel Discussion (Misc queries) 4 February 4th 07 10:34 PM
Count by date and hour ChristiaanV Excel Worksheet Functions 4 August 12th 06 12:26 AM


All times are GMT +1. The time now is 07:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"