Public Sub subKopiujDoZakresu(rngZrodlo As Range, rngCel As Range, Optional blnFormat As Boolean)Dim lngIlRek As Long, lngIlKol As Long
Dim intRek As Integer, intKol As Integer
Dim strSheet As String, strWb As String
strSheet = rngCel.Parent.Name
strWb = rngCel.Worksheet.Parent.Name
lngRek = rngCel.Row
lngKol = rngCel.Column
lngIlRek = rngCel.Rows.Count
lngIlKol = rngCel.Columns.Count
If blnFormat = False Then
Workbooks(strWb).Sheets(strSheet).Cells(rngCel.Row, rngCel.Column).Value = rngZrodlo.Value
Else
Workbooks(strWb).Sheets(strSheet).Cells(rngCel.Row, rngCel.Column).Value(11) = rngZrodlo.Value(11)
End If
Workbooks(strWb).Sheets(strSheet).Activate
For c = 0 To lngIlKol - 1
If c >= 1 Then
Range(Cells(lngRek, lngKol + c - 1), Cells(lngRek, lngKol + c)).FillRight
End If
If lngIlRek > 1 Then
Range(Cells(lngRek, lngKol + c), Cells(lngIlRek, lngKol + c)).FillDown
End If
Next c
End Sub