Sub Filldownrows() Worksheets("Sheet1").Activate Dim lngLastRow As Long Dim lngRow As Long Dim strSubcat As String Dim strCat As String With ActiveSheet strCat = .Range("A2") strSubcat = .Range("B2") lngLastRow = .Cells(Rows.Count, "A").End(xlUp).Row For lngRow = 3 To lngLastRow If Not IsEmpty(.Cells(lngRow, "A")) Then If .Cells(lngRow, "A") <> strCat Then strCat = .Cells(lngRow, "A") strSubcat = "" End If End If If IsEmpty(.Cells(lngRow, "B")) Then .Cells(lngRow, "A") = strCat .Cells(lngRow, "B") = strSubcat Else strSubcat = .Cells(lngRow, "B") .Cells(lngRow, "A") = strCat End If Next End With End Sub
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.