Общее·количество·просмотров·страницы

среда, 31 марта 2010 г.

Usage range method to entern formula in specific range

Данный макрос был расположен в каждом листе файла.
Const MyFile = "'[Кадры АБТЭц.xls]6'"
Sub aaa()
Sheets("6").Select
Dim c As Range
Dim s As String
Dim myRange As Range
Set myRange = [L13:P40,E42:I43,E58:Q67,E79:M88,E102:H110,E122:H152]
For Each c In myRange
s = c.Formula
l2 = Len(s)
pos2 = InStr(1, s, "!")
pos3 = InStr(1, s, "+")
If pos2 <> 0 Then s1 = Mid(s, pos2, pos3 - pos2): s2 = s & "+" & MyFile & s1: _
c.Formula = s2
Next c
End Sub

Комментариев нет:

Отправить комментарий