Greetings all!
I created an Excel program/workbook that uses vba macros throughout for others to benefit from. The only problem is, some people do not have Excel 2011, instead they only have 2008 which does not utilize macros.
1. I was told I can still automate Excel using applescript. If this is true, can this script be shared with other users?
2. How would I change this vba code to applescript? (it calls a UserInterface, copies a hidden worksheet, and changes its name). It seems simple in theory, I just don't know where to start.
Any help would be greatly appreciated!! Thank you for your time!!
I created an Excel program/workbook that uses vba macros throughout for others to benefit from. The only problem is, some people do not have Excel 2011, instead they only have 2008 which does not utilize macros.
1. I was told I can still automate Excel using applescript. If this is true, can this script be shared with other users?
2. How would I change this vba code to applescript? (it calls a UserInterface, copies a hidden worksheet, and changes its name). It seems simple in theory, I just don't know where to start.
Code:
Sub Button1_Click()
UserForm1.Show
End Sub
Private Sub ComboBox1_Change()
Dim index As Integer
index = ComboBox1.ListIndex
ComboBox2.Clear
Select Case index
Case Is = 0
With ComboBox2
.AddItem "1QTR"
.AddItem "2QTR"
.AddItem "3QTR"
.AddItem "4QTR"
End With
Case Is = 1
With ComboBox2
.AddItem "January"
.AddItem "Febuary"
.AddItem "March"
.AddItem "April"
.AddItem "May"
.AddItem "June"
.AddItem "July"
.AddItem "August"
.AddItem "September"
.AddItem "October"
.AddItem "Novenber"
.AddItem "December"
End With
End Select
End Sub
Private Sub CommandButton1_Click()
Dim myWorksheet As Worksheet
Dim myWorksheetName As String
myWorksheetName = Format(ComboBox2)
For Each myWorksheet In Worksheets
If myWorksheet.Name = myWorksheetName Then
MsgBox "Sheet already exists...Make necessary " & _
"corrections and try again."
Exit Sub
End If
Next myWorksheet
If ComboBox1 = "MON PLAN" Then
Sheets("Template1").Visible = True
Sheets("Template1").Copy After:=Worksheets(Worksheets.Count)
' RENAME
ActiveSheet.Name = myWorksheetName
Sheets("Sheet63").Visible = False
Else
Sheets("Template2").Visible = True
Sheets("Template2").Copy After:=Worksheets(Worksheets.Count)
' RENAME
ActiveSheet.Name = myWorksheetName
Sheets("Template2").Visible = False
End If
End Sub
Private Sub UserForm_Initialize()
With ComboBox1
.AddItem "QTR PLAN"
.AddItem "MON PLAN"
End With
End Sub
Sub MONTH_PLANNER()
End Sub
Any help would be greatly appreciated!! Thank you for your time!!
Last edited by a moderator: