Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Wrong number of Arguments or Invalid property assignment


Hello - great tips on this website - giving me some great ideas - don
know whether I use them right yet - still knew to this.

Below is my macro for taking a range of data in two columns, pivotin
it, and replacing the original data with the pivoted data. I have ha
this working fine in a simpler form - but I am at present improving i
to work on a variable data range!!

Problem I have atm is that I get a "Wrong number of Arguments o
Invalid property assignment" compile error whereas the same cod
previously worked fine - any ideaS?????? i have pointed out the poin
below where the problem starts!!!


Sub Pivot_V5()
'
' Pivot_V5 Macro
' Macro recorded 17/07/2005 by Greg Sheriston
'

'
ActiveWorkbook.Names.Add Name:="List", RefersToR1C1:= _
"=OFFSET(Sheet3!R1C1,4,0,COUNTA(Sheet3!C1),2)"

ActiveWorkbook.Names.Add Name:="List2", RefersToR1C1:= _
"=OFFSET(Sheet3!R1C1,5,0,COUNTA(Sheet3!C1),2)"

ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase
SourceData:="List"). _
CreatePivotTable TableDestination:="'[Pivo
test.xls]Sheet3'!R6C5", _
TableName:="PivotTable3"
DefaultVersion:=xlPivotTableVersion10
ActiveSheet.PivotTables("PivotTable3").AddFields RowFields:="St
no"

ActiveSheet.PivotTables("PivotTable3").PivotFields ("Val").Orientation
_
xlDataField
ActiveWorkbook.ShowPivotTableFieldList = True
Application.CommandBars("PivotTable").Visible = False
ActiveWorkbook.ShowPivotTableFieldList = False



Range("List2").Select <-----THIS BIT
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents



Range("E8:F8").Select
Range(Selection, Selection.End(xlDown)).Select
Range("E8:F32").Select
Selection.Copy


Range("A6").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Sort Key1:=Range("B6"), Order1:=xlAscending
Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
_
DataOption1:=xlSortNormal
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
Selection.NumberFormat = "#,##0.00_ ;[Red]-#,##0.00 "
Columns("E:F").Select
Selection.Delete Shift:=xlToLeft



Range("A1").Select
End Sub


ANY ideas greatly appreciated - thanks in advance Gre

--
Turi
-----------------------------------------------------------------------
Turin's Profile: http://www.excelforum.com/member.php...fo&userid=2498
View this thread: http://www.excelforum.com/showthread.php?threadid=38786

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 303
Default Wrong number of Arguments or Invalid property assignment

Try
Application.Goto Reference:="List2"

--
Greetings from New Zealand
Bill K

"Turin" wrote in
message ...

Hello - great tips on this website - giving me some great ideas - dont
know whether I use them right yet - still knew to this.

Below is my macro for taking a range of data in two columns, pivoting
it, and replacing the original data with the pivoted data. I have had
this working fine in a simpler form - but I am at present improving it
to work on a variable data range!!

Problem I have atm is that I get a "Wrong number of Arguments or
Invalid property assignment" compile error whereas the same code
previously worked fine - any ideaS?????? i have pointed out the point
below where the problem starts!!!


Sub Pivot_V5()
'
' Pivot_V5 Macro
' Macro recorded 17/07/2005 by Greg Sheriston
'

'
ActiveWorkbook.Names.Add Name:="List", RefersToR1C1:= _
"=OFFSET(Sheet3!R1C1,4,0,COUNTA(Sheet3!C1),2)"

ActiveWorkbook.Names.Add Name:="List2", RefersToR1C1:= _
"=OFFSET(Sheet3!R1C1,5,0,COUNTA(Sheet3!C1),2)"

ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase,
SourceData:="List"). _
CreatePivotTable TableDestination:="'[Pivot
test.xls]Sheet3'!R6C5", _
TableName:="PivotTable3",
DefaultVersion:=xlPivotTableVersion10
ActiveSheet.PivotTables("PivotTable3").AddFields RowFields:="Stk
no"

ActiveSheet.PivotTables("PivotTable3").PivotFields ("Val").Orientation =
_
xlDataField
ActiveWorkbook.ShowPivotTableFieldList = True
Application.CommandBars("PivotTable").Visible = False
ActiveWorkbook.ShowPivotTableFieldList = False



Range("List2").Select <-----THIS BIT
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents



Range("E8:F8").Select
Range(Selection, Selection.End(xlDown)).Select
Range("E8:F32").Select
Selection.Copy


Range("A6").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Sort Key1:=Range("B6"), Order1:=xlAscending,
Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom,
_
DataOption1:=xlSortNormal
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
Selection.NumberFormat = "#,##0.00_ ;[Red]-#,##0.00 "
Columns("E:F").Select
Selection.Delete Shift:=xlToLeft



Range("A1").Select
End Sub


ANY ideas greatly appreciated - thanks in advance Greg


--
Turin
------------------------------------------------------------------------
Turin's Profile:
http://www.excelforum.com/member.php...o&userid=24987
View this thread: http://www.excelforum.com/showthread...hreadid=387864



Reply
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
Compile Error: Wrong arguments or Invalid property Brent E Excel Discussion (Misc queries) 3 May 1st 07 07:11 PM
Invalid property value. Don Wiss Excel Programming 7 July 16th 05 12:17 AM
Runtime error 380: Could not set the List property. invalid property value of listbox jasgrand Excel Programming 0 October 6th 04 09:28 PM
Invalid Property Value Error LarryP[_2_] Excel Programming 6 August 3rd 04 07:33 PM


All times are GMT +1. The time now is 11:41 AM.

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

About Us

"It's about Microsoft Excel"