Sub CreateForm()
dim picPath as string
picPath = "C:\YourFOlder\"
ActiveWorkbook.Sheets.Add Before:=Worksheets(Worksheets.Count)
Rows.RowHeight = 10.5
With Sheets(1).Pictures.Insert( _
picPath & "logo.jpg")
.Left = 150
.Top = 0
End With
With Sheets(1).Range("g7:i7")
.Merge
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Value = Format(Date, "dd.mm.yyyy")
.Font.Bold = False
.Font.Italic = False
.Font.Underline = -4142
.Font.Size = 8
.Font.Name = "Verdana"
End With
With Sheets(1).Range("f" & pos & ":i" & pos).Borders
.LineStyle = xlContinuous
.Color = vbBlack
.Weight = xlThin
End With
end sub
Unique values
Set contractsCollection = New Collection
Set yourRange = ActiveSheet.Range("a1", Range("a1").End(xlDown))
For Each UrRangeEl In yourRange
For Each UrContractsCollectionEl In contractsCollection
If UrRangeEl = UrcontractsCollectionEl Then
GoTo continueLoop
End If
Next elk
contractsCollection .Add item:=UrRangeEl
continueLoop:
Next elz
Page setup
With Sheets(1).PageSetup
'.PrintTitleRows = "$3:$3"
'.PrintTitleColumns = "$B:$B"
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With