< návrat zpět
MS Excel
Téma: Svyhledat + kopírování formátu
Zaslal/a Taps 28.1.2016 12:53
Zdravím, používám funkci Svyhledat, a potřebuji, aby byla hodnota buňky přebrána včetně formátování...Jde to nějak?
Děkuji
Taps(3.2.2016 17:32)#029824 Moje druha priloha obsahuje upravena data vcetne sloucenych bunek..kdyz ctu vsechny prispevky tak nikde jsem nepsal ze mam sloucene zdrojove bunky
citovat
No tak to obabrime takto:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim N As Long, V As String, H As Single
If Target.Column <> 1 Then Exit Sub
With Sheets("Zdroj")
On Error Resume Next
N = WorksheetFunction.Match(Target.Value, .Columns(1), 0)
If Err <> 0 Then Target.Offset(0, 1) = "": Exit Sub
V = .Cells(N, 2)
H = .Cells(N, 2).RowHeight
With Target.Offset(0, 1).MergeArea(1)
V = Replace(V, " Adresa:", vbCrLf & "Adresa:")
.Value = V
.Font.Bold = False
.Characters(Start:=1, Length:=17).Font.Bold = True
.Characters(Start:=InStr(1, V, "Adresa:"), Length:=7).Font.Bold = True
.EntireRow.RowHeight = H
End With
End With
End Subcitovat