Created
September 25, 2015 02:58
-
-
Save ulvham/9079dfb9ab913be7d709 to your computer and use it in GitHub Desktop.
close_month
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Sub CommandButton1_Click() | |
On Error Resume Next | |
path1 = [Q1] | |
path2 = [Q2] | |
shablon = [Q3] | |
Application.ScreenUpdating = False | |
For Each num In ActiveSheet.Range([Q4]) | |
path_ = Replace(Replace(Replace(shablon, "№", num.Row), "@@@", path2), "###", path1) | |
ActiveSheet.Cells(num.Row, "P").FormulaLocal = "=" + path_ | |
Next num | |
refresh_ path1 & path2 | |
Application.ScreenUpdating = True | |
MsgBox "OK" | |
End Sub | |
Function refresh_(path) | |
On Error Resume Next | |
ActiveWorkbook.UpdateLink Name:=path, Type:=xlExcelLinks | |
End Function | |
Private Sub CommandButton2_Click() | |
refresh_ path1 & path2 | |
MsgBox "OK" | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment