G
GMC
Hi,
I have some code that works fine when added into a module within a workbook.
However, as i want to ensure all users are able to use it i have created an
add-in (xlam). Toolbars created using xml.
When i attempt to execute the macro i receive the message "wrong number of
arguments or inavlid property assignment".
My code is as follows:
Sub fmat
Dim c1 As Range
Dim c2 As Range
Dim lnLastRow As Long
Application.ScreenUpdating = False
With ActiveSheet
Columns("E:E").ColumnWidth = 40
Range("A:A,C:C,F:J,L:L").Delete
..UsedRange
lnLastRow = .Cells.SpecialCells(xlCellTypeLastCell).Row
Set bglc1 = .Range("A1", .Cells(lnLastRow, "A"))
c1.AutoFilter Field:=1, Criteria1:="="
c1.SpecialCells(xlCellTypeVisible).EntireRow.Delete
Set c2 = .Range("A1", .Cells(lnLastRow, "A"))
c2.AutoFilter Field:=1, Criteria1:="Last Year"
c2.SpecialCells(xlCellTypeVisible).EntireRow.Delete
..Rows("1:1").Insert Shift:=xlDown
..Range("A11").Value = Array("Last Year", "Account", "Account Name",
"Balance")
..UsedRange
End With
Columns("E:E").Copy
Columns("D").PasteSpecial Paste:=xlPasteValues, Operation:=xlSubtract, _
SkipBlanks:=False, Transpose:=False
Range("E:E").Delete
Application.ScreenUpdating = True
End Sub
I have some code that works fine when added into a module within a workbook.
However, as i want to ensure all users are able to use it i have created an
add-in (xlam). Toolbars created using xml.
When i attempt to execute the macro i receive the message "wrong number of
arguments or inavlid property assignment".
My code is as follows:
Sub fmat
Dim c1 As Range
Dim c2 As Range
Dim lnLastRow As Long
Application.ScreenUpdating = False
With ActiveSheet
Columns("E:E").ColumnWidth = 40
Range("A:A,C:C,F:J,L:L").Delete
..UsedRange
lnLastRow = .Cells.SpecialCells(xlCellTypeLastCell).Row
Set bglc1 = .Range("A1", .Cells(lnLastRow, "A"))
c1.AutoFilter Field:=1, Criteria1:="="
c1.SpecialCells(xlCellTypeVisible).EntireRow.Delete
Set c2 = .Range("A1", .Cells(lnLastRow, "A"))
c2.AutoFilter Field:=1, Criteria1:="Last Year"
c2.SpecialCells(xlCellTypeVisible).EntireRow.Delete
..Rows("1:1").Insert Shift:=xlDown
..Range("A11").Value = Array("Last Year", "Account", "Account Name",
"Balance")
..UsedRange
End With
Columns("E:E").Copy
Columns("D").PasteSpecial Paste:=xlPasteValues, Operation:=xlSubtract, _
SkipBlanks:=False, Transpose:=False
Range("E:E").Delete
Application.ScreenUpdating = True
End Sub