Hello,
This code has me all sorts of frustrated. It seems like it should work to me but it's not.
So what I want to accomplish is to move data from the mod sheet to the Final Sheet. Specifically, Columns (B:D) data on each populated row in the mod sheet. So for example, currently, the value in mod sheet B2 should move to the Final Sheet A2, the value in mod sheet C2 should move to the Final Sheet A3, and the value in mod sheet D2 should move to the Final Sheet A4, Then it should move to mod sheet row 3 and repeat and on and on.
My code is posted below, Any help is greatly appreciated!
![]()
Private Sub cb_Click() Dim MyCell As Variant, modLR As Integer, FinalLR As Integer, MyRange As Range On Error Resume Next ActiveWorkbook.Names("MyRange").Delete On Error GoTo 0 modLR = Sheets("mod").Range("A" & Rows.Count).End(xlUp).Row FinalLR = Sheets("Final").Range("A" & Rows.Count).End(xlUp).Row + 1 Sheets("mod").Range("$A$2:$A" & modLR).Name = "MyRange" For Each MyCell In Sheets("mod").Range("MyRange") Sheets("Final").Range("$A$2:$A$" & FinalLR).Value = MyCell.Offset(0, 1).Value Sheets("Final").Range("$A$2:$A$" & FinalLR + 1).Value = MyCell.Offset(0, 2).Value Sheets("Final").Range("$A$2:$A$" & FinalLR + 2).Value = MyCell.Offset(0, 3).Value FinalLR = FinalLR + 2 Next MyCell End Sub
Bookmarks