markpickford
New Member
- Joined
- Jul 11, 2012
- Messages
- 1
Hi,
This is my first post and I hope someone can help me. I am a complete novice with excel, macros and VBA, but by borrowing ideas and finding scripts from various sources I have been able to put together an expenses spreadsheet for my business that works as I want it to.
I have recently moved to Excel 2011 (mac) from Excel 2007 (PC) and the date picker part of my spreadsheet will not work.
The code is below:
Private Sub Calendar1_Click()
ActiveCell.Value = CDbl(Calendar1.Value)
ActiveCell.Select
Calendar1.Visible = False
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Application.Intersect(Range("A9:A28,A34:A53"), Target) Is Nothing Then
Calendar1.Left = Target.Left + Target.Width - Calendar1.Width
Calendar1.Top = Target.Top + Target.Height
Calendar1.Visible = True
' select Today's date in the Calendar
Calendar1.Value = Date
ElseIf Calendar1.Visible Then Calendar1.Visible = False
End If
End Sub
The first error I get when running it is "Compile Error Can't Find Project or Library'.
If I then click "OK", 'Run and then 'Reset' I can view the available librarys and those that are ticked are :
If I untick the last, missing, one (as advised on another site) I get an error 'Runtime Error 424 - Object Required.
I am at a complete loss to understand the problem and would welcome any help that can be offered.
Thanks in advance.
Mark
This is my first post and I hope someone can help me. I am a complete novice with excel, macros and VBA, but by borrowing ideas and finding scripts from various sources I have been able to put together an expenses spreadsheet for my business that works as I want it to.
I have recently moved to Excel 2011 (mac) from Excel 2007 (PC) and the date picker part of my spreadsheet will not work.
The code is below:
Private Sub Calendar1_Click()
ActiveCell.Value = CDbl(Calendar1.Value)
ActiveCell.Select
Calendar1.Visible = False
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Application.Intersect(Range("A9:A28,A34:A53"), Target) Is Nothing Then
Calendar1.Left = Target.Left + Target.Width - Calendar1.Width
Calendar1.Top = Target.Top + Target.Height
Calendar1.Visible = True
' select Today's date in the Calendar
Calendar1.Value = Date
ElseIf Calendar1.Visible Then Calendar1.Visible = False
End If
End Sub
The first error I get when running it is "Compile Error Can't Find Project or Library'.
If I then click "OK", 'Run and then 'Reset' I can view the available librarys and those that are ticked are :
- Visual Basic for Applications
- Microsoft Excel 14.0 Object Library
- OLE Automation
- Microsoft Office 14.0 Object Library
- Missing: Microsoft Windows Common Controls 0 2.6.0 (SP4)
If I untick the last, missing, one (as advised on another site) I get an error 'Runtime Error 424 - Object Required.
I am at a complete loss to understand the problem and would welcome any help that can be offered.
Thanks in advance.
Mark