Hi -
I am trying to figure out a way to use VBA code to copy the contents of a row based on a criteria down multiple cells until the next row that has a different value. Then I want the new value to be copied and pasted down until the next row has a different value, etc. Attached is the sample worksheet. In the worksheet, you will see the various regions. I want the region to be copied to column A until the next region and then copy that region down, and etc.
Here is the code I came up with but it doesn't work
With Sheets("Summary") lastcolumn1 = .Range("A1").SpecialCells(xlCellTypeLastCell).Column End With lastrow3 = Sheets("Summary").Range("B" & Rows.Count).End(xlUp).Row For i = 2 To lastrow3 If Cells(i, 2).Value = "East Region " Then Range("A5" & lastrow3").Value = "East Region " ElseIf Cells(i, 2).Value = "Midwest Region" Then Range("A5" & lastrow 3).Value = "Midwest Region" ElseIf Cells(i, 2).Value = "West Region" Then Range("A5" & lastrow3).Value = "West Region" End If Next Application.ScreenUpdating = True End Sub