У меня есть код, который ищет значение в другом шетте, после поиска я хочу скопировать то, что на оригинальном листе ниже, в другие ячейки, но я хочу скопировать только то, что содержит информацию.Затем вернитесь к найденному значению и вставьте ниже последнюю ячейку с информацией.
В примере кода было найдено partida.value в листах ("bancos") cell = H6 Я хочу скопировать информацию в Sheets ("Bu ") B7: C19 и его должны получить приклеенные сильфоны (" bancos ") G13: h13
Private Sub C1_Click()
Dim Partida As String
Dim Rng As Range
Partida = Worksheets("BU").Range("c3").Value
If Trim(Partida) <> "" Then
With Sheets("Bancos").Rows("6:6")
Set Rng = .Find(What:=Partida, after:=.Cells(.Cells.Count), LookIn:=xlValues, lookat:=xlWhole, searchorder:=xlByColumns, SearchDirection:=xlNext, MatchCase:=False)
If Not Rng Is Nothing Then
Worksheets("Bu").Activate
ActiveSheet.Range("b7:c19").Select
'i want to copy only the filled cells in the range (b7:c19); the filled cells in b and c
Selection.Copy
Application.Goto Rng, True
'I want to paste in the last cells with information within the right and below cells from the "rng" found in cells G and H
Else
MsgBox "Not found"
End If
End With
End If
End Sub
Нет ошибок msg tho