I am trying to do what i did last time with this inquiry but it needs to be copied into a single cell rather than a range.
This is the current code that i have:
Dim myCell As Range, endCell As Long, destCell As Range
Application.ScreenUpdating = False
With Sheets("Last report")
For Each myCell In .Range("A2:A" & .Range("A" & Rows.Count).End(xlUp).Row)
If myCell.Value <> myCell.Offset(-1).Value Then
endCell = .Columns("A").Find(myCell.Value, , xlValues, , xlByRows, xlPrevious).Row
Set destCell = Sheets("Open PO's Report").Columns("A").Find(myCell.Value, , xlValues, , xlByRows, xlNext)
If Not destCell Is Nothing Then Range(.Cells(myCell.Row, "A"), .Cells(endCell, "J")).Copy destCell
End If
Next
End With
Application.ScreenUpdating = True
As i am new to Macros and VBA i am not understanding exactly what does what with this code but i know that it will go through a cell column range 1 by 1 and find the match of Cells in A column and paste the entire cell row into the matching row, what i need is similar but instead of copying and pasting the entire cell row, i just need it to copy a single cell value an paste into the matching row cell "I".
Can someone explain how this is done?
This is the current code that i have:
Dim myCell As Range, endCell As Long, destCell As Range
Application.ScreenUpdating = False
With Sheets("Last report")
For Each myCell In .Range("A2:A" & .Range("A" & Rows.Count).End(xlUp).Row)
If myCell.Value <> myCell.Offset(-1).Value Then
endCell = .Columns("A").Find(myCell.Value, , xlValues, , xlByRows, xlPrevious).Row
Set destCell = Sheets("Open PO's Report").Columns("A").Find(myCell.Value, , xlValues, , xlByRows, xlNext)
If Not destCell Is Nothing Then Range(.Cells(myCell.Row, "A"), .Cells(endCell, "J")).Copy destCell
End If
Next
End With
Application.ScreenUpdating = True
As i am new to Macros and VBA i am not understanding exactly what does what with this code but i know that it will go through a cell column range 1 by 1 and find the match of Cells in A column and paste the entire cell row into the matching row, what i need is similar but instead of copying and pasting the entire cell row, i just need it to copy a single cell value an paste into the matching row cell "I".
Can someone explain how this is done?