Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '=========================Declarations=========================
- Public MySelection As String
- Public IsFile As Boolean
- Public Sub GetSelection()
- MySelection = ActiveCell.Value
- End Sub
- Public Sub LinkCheck()
- 'MySelection = ActiveCell.Value
- If Len(ActiveCell.Value) > 0 And Left(ActiveCell.Value, 1) = "~" Then
- MySelection = Mid(ActiveCell.Value, 2)
- End If
- End Sub
- Public Sub FileCheck()
- IsFile = False
- If ActiveCell.Value = "Open Me" Then
- MySelection = ActiveCell.Offset(-1, 0).Value ' Offset(-1, 0) moves one row up from the active cell
- Range("N8").Value = MySelection
- Range("N9:N10000").Font.ColorIndex = xlAutomatic
- IsFile = True
- ElseIf ActiveCell.Value = "Open Me!" Then
- MySelection = ActiveCell.Offset(-1, 0).Value ' Offset(-1, 0) moves one row up from the active cell
- MySelection = Left(MySelection, Len(MySelection) - 1)
- Range("N8").Value = MySelection
- Range("N9:N10000").Font.ColorIndex = xlAutomatic
- IsFile = True
- End If
- End Sub
- Public Sub AutoFit()
- Columns("B:L").EntireColumn.AutoFit
- End Sub
- Public Sub FormatSelection()
- Call GetSelection
- Call LinkCheck
- Call FileCheck
- End Sub
- Sub refresh()
- Range("N9:N10000").Font.ColorIndex = xlAutomatic
- End Sub
- '=========================OPEN=========================
- Sub Open0()
- Call FormatSelection
- If IsFile Then
- Exit Sub
- End If
- Range("C8").Value = Range("B8") + MySelection
- Call AutoFit
- End Sub
- Sub Open1()
- Call FormatSelection
- If IsFile Then
- Exit Sub
- End If
- Range("D8").Value = Range("C8").Value + MySelection
- Call AutoFit
- End Sub
- Sub Open2()
- Call FormatSelection
- If IsFile Then
- Exit Sub
- End If
- Range("E8").Value = Range("D8").Value + Selection
- Call AutoFit
- End Sub
- Sub Open3()
- Call FormatSelection
- If IsFile Then
- Exit Sub
- End If
- Range("F8").Value = Range("E8").Value + Selection
- Call AutoFit
- End Sub
- Sub Open4()
- Call FormatSelection
- If IsFile Then
- Exit Sub
- End If
- Range("G8").Value = Range("F8").Value + Selection
- Call AutoFit
- End Sub
- Sub Open5()
- Call FormatSelection
- If IsFile Then
- Exit Sub
- End If
- Range("H8").Value = Range("G8").Value + Selection
- Call AutoFit
- End Sub
- Sub Open6()
- Call FormatSelection
- If IsFile Then
- Exit Sub
- End If
- Range("I8").Value = Range("H8").Value + Selection
- Call AutoFit
- End Sub
- Sub Open7()
- Call FormatSelection
- If IsFile Then
- Exit Sub
- End If
- Range("J8").Value = Range("I8").Value + Selection
- Call AutoFit
- End Sub
- Sub Open8()
- Call FormatSelection
- If IsFile Then
- Exit Sub
- End If
- Range("K8").Value = Range("J8").Value + Selection
- Call AutoFit
- End Sub
- Sub Open9()
- Call FormatSelection
- If IsFile Then
- Exit Sub
- End If
- Range("L8").Value = Range("K8").Value + Selection
- Call AutoFit
- End Sub
- '=========================CLOSE=========================
- Sub Close1()
- Range("C8").Value = 0
- Call AutoFit
- End Sub
- Sub Close2()
- Range("D8").Value = 0
- Call AutoFit
- End Sub
- Sub Close3()
- Range("E8").Value = 0
- Call AutoFit
- End Sub
- Sub Close4()
- Range("F8").Value = 0
- Call AutoFit
- End Sub
- Sub Close5()
- Range("G8").Value = 0
- Call AutoFit
- End Sub
- Sub Close6()
- Range("H8").Value = 0
- Call AutoFit
- End Sub
- Sub Close7()
- Range("I8").Value = 0
- Call AutoFit
- End Sub
- Sub Close8()
- Range("J8").Value = 0
- Call AutoFit
- End Sub
- Sub Close9()
- Range("K8").Value = 0
- Call AutoFit
- End Sub
- Sub Close10()
- Range("L8").Value = 0
- Call AutoFit
- End Sub
- Sub CloseFile()
- Range("N8").Value = 0
- Rows("9:10000").EntireRow.AutoFit
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement