Try this code - You can populate the data in the Rhonda sheet and then run the macro. The data will move to the next sheet in the appropriate column -
Option Explicit
Sub trending()
Dim i As Long, lcol As Long
Application.ScreenUpdating = False
With Worksheets("Trending MINS")
lcol = .Range("XFD2").End(xlToLeft).Column
For i = 2 To lcol
If .Cells(2, i).Value = Worksheets("Rhonda").Range("M2").Value Then
Worksheets("Rhonda").Range("O3:O39").Copy
.Cells(3, i).PasteSpecial (xlPasteValues)
.Cells(19, i).ClearContents
.Cells(36, i).ClearContents
End If
Next i
End With
Msgbox "Transfer complete"
Application.ScreenUpdating = True
End Sub
Copy the Excel VBA code
Select the workbook in which you want to store the Excel VBA code
Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
Choose Insert | Module
Where the cursor is flashing, choose Edit | Paste
To run the Excel VBA code:
Choose View | Macros
Select a macro in the list, and click the Run button
Bookmarks