Hello everyone,
need your help to edit the following macro:
this code is coping the B to the right place but i need that code to copy from row B until the third last one and past exactly where this code says to... can anyone edit the copy range please???
Many thanks
need your help to edit the following macro:
Code:
Sub x()
Dim myValue As Variant
myValue = InputBox("Give me some input")
Dim rFind As Range, ws As Worksheet, wb1 As Workbook, wb2 As Workbook
Dim RngCp As String
RngCp = Rows("2:" & Range([A1], ActiveSheet.UsedRange).Rows.Count - 2).Select
Set wb1 = ThisWorkbook 'containing macro
Set wb2 = Workbooks.Open("L:\...\PRO " & myValue & ".txt") 'put details of file being opened
Set rFind = wb1.Sheets("pro").Columns(2).Find(What:=wb2.Sheets("pro " & myValue").Range("B2"), _
Lookat:=xlWhole, MatchCase:=False, SearchFormat:=False)
If Not rFind Is Nothing Then
rFind.EntireRow.Value = wb2.Sheets("pro " & myValue).Range("B2").EntireRow.Value
End If
'Windows("pro " & myValue & ".txt").Close
End Sub
this code is coping the B to the right place but i need that code to copy from row B until the third last one and past exactly where this code says to... can anyone edit the copy range please???
Many thanks