Я хочу сначала найти ячейку банка в столбце G, а затем выбрать ячейку в том же столбце F. Затем выбрать данные из этой ячейки для последней заполненной ячейки и скопировать.затем снова зайдите в пустую ячейку столбца G и вставьте значения.Пожалуйста, помогите мне.
Sub copyy2()
Dim sourceCol As Integer, rowCount As Integer, currentRow As Integer
Dim currentRowValue As String
Dim A As Long
Dim otherCol As Integer
Dim cell As Excel.Range
sourceCol = 8 'column H has a value of 8
otherCol = sourceCol - 1 'column before H
rowCount = Cells(Rows.Count, sourceCol).End(xlUp).Row
'for every row, find the first blank cell and select it
With Sheets("sheet1")
For currentRow = 1 To rowCount
currentRowValue = Cells(currentRow, sourceCol).Value
If IsEmpty(currentRowValue) Or currentRowValue = "" Then
A = currentRow
'cell = Cells(currentRow, sourceCol)
Exit For
End If
Next
'A = cell.Row
Cells(A, otherCol).Select
Range(Selection, Cells(A, otherCol).End(xlDown)).Select
Selection.copy
Range(Selection, Cells(A, sourceCol)).Select
End With
End Sub