运行宏时出现错误消息。附加编码。请任何一个帮助。在行totDay = splittedday(1)
Sub ChartWorking()
Dim PlanDayAddress As String
Dim splittedAddr1 As Variant, splittedday As Variant
Dim lastrow As Long, lastcol As Long, plannedDayRow As Long
Dim FirstDayCol As Long, checkingrow As Long
Dim Daystring As String, PlotAnchor As String
Dim i As Long, Loop1 As Long
Dim locallastAddr As String
PlotAnchor = "Planned Day"
clearplotarea
Range("CalculatedColumns").Columns.Hidden = False
PlanDayAddress = "$C$4"
splittedAddr1 = Split(PlanDayAddress, "$")
plannedDayRow = ActiveSheet.Range(PlanDayAddress).Row
plannedDayCol = ActiveSheet.Range(PlanDayAddress).Column
'Find Number of Days
lastrow = ActiveSheet.Cells(Rows.Count, plannedDayCol).End(xlUp).Row
' to skip all if day planner is not populated with data
If plannedDayRow = lastrow Then
Range("CalculatedColumns").Columns.Hidden = True
Exit Sub
End If
Daystring = Cells(lastrow, plannedDayCol).Value
splittedday = Split(Daystring, " ")
totDay = splittedday(1)
Range("CalculatedColumns").Columns.Hidden = True