Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi
What value shows for lastrow? -- Regards Roger Govier "houghi" wrote in message ... I get a 'Runtime error 1004'. Reference is not valid. With 'debug' the whole line is yellow. When I change !Range(Cells(2,1),cells(lastrow,5)) back to !R2C1:R37C5 then it works again. Could it be that this not work because I work with Excel 2000? If that is the case, is there a different solution? Roger Govier wrote: Hi you could insert some code to find the lastrow Dim lastrow as long Lastrow = Cells(Rows.Count, 1).End(xlUp).row ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _ "'Y:\\[Report.XLS]Sheet1'!Range(Cells(2,1),cells(lastrow,5)) _ ).CreatePivotTable TableDestination:=Range("A4"), TableName:="PivotTable1" houghi -- Knock-knock. Who's there? Under the Patriot Act, we don't have to tell you that. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Scripting in Excel 2007 | Excel Discussion (Misc queries) | |||
Scripting from command line | Excel Discussion (Misc queries) | |||
Scripting Question | Setting up and Configuration of Excel | |||
Excel scripting,programming | New Users to Excel | |||
Scripting.FileSystemObject | Excel Discussion (Misc queries) |