Eskypades
Board Regular
- Joined
- Nov 19, 2009
- Messages
- 98
I have the following code in my worksheet (forgive the crude coding). It works just fine on my PC but when I send the worksheet to my client and he runs it on a Mac, it crashes Excel. The crash report is 48 pages long and includes the following error message:
"Error Signature:
Exception: EXC_BAD_ACCESS
ExceptionEnumString: 1
Exception Code: KERN_INVALID_ADDRESS (0x0000000000000000)"
Since I don't have a Mac, I'm unsure what is causing the problem in my coding. Any help would be greatly appreciated.
Thanks,
Stephen
"Error Signature:
Exception: EXC_BAD_ACCESS
ExceptionEnumString: 1
Exception Code: KERN_INVALID_ADDRESS (0x0000000000000000)"
Since I don't have a Mac, I'm unsure what is causing the problem in my coding. Any help would be greatly appreciated.
Code:
Sub Update()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Set Rng = Worksheets("Stock").Range("A2:A100000")
' Count the number of rows that have data
RowCount = Application.WorksheetFunction.CountA(Rng)
Sheets.Add After:=ActiveSheet
ActiveSheet.Name = "Calc"
Range("A1").Value = "SOLD"
Range("A2").Formula = "=Sold+SUMIF(Import!$M:$M,STOCK!A2,Import!$N:$N)"
Range("A2").Select
Selection.Copy
Range("A2" & ":" & ("A" & RowCount + 1)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("A1:" & "A" & RowCount + 1).Select
Selection.Copy
Sheets("STOCK").Select
Range("Sold").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Import").Select
Cells.Select
Selection.ClearContents
Sheets("Calc").Select
ActiveWindow.SelectedSheets.Delete
Sheets("STOCK").Select
Range("A1").Select
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
Thanks,
Stephen