Livin404
Well-known Member
- Joined
- Jan 7, 2019
- Messages
- 743
- Office Version
- 365
- 2019
- Platform
- Windows
Greetings, I have a macro below which works properly by using advanced filter and pastes the range on to a second worksheet of the same workbook. This process runs about six times and works properly in all instances. What I'm looking for is a macro that will insert text above each result. It will be a description and instructions of each result. I suspect to make it work this will have to be done with a merged cell using text wrap. I only need to have those inserted rows with text to be merged with text wrap. The Columns will run from A to I. Thank you,
VBA Code:
Sub CatI_Filter()
Dim rgData As Range, rgCriteria As Range, rgOutput As Range
Dim sh As Worksheet
Dim LstRw As Long
Set rgData = ThisWorkbook.Worksheets("Database").Range("A8").CurrentRegion
Set rgCriteria = ThisWorkbook.Worksheets("Database").Range("A1").CurrentRegion
Set rgOutput = ThisWorkbook.Worksheets("Deficiencies").Range("A1")
Set sh = Sheets("Deficiencies")
With sh
LstRw = .Cells(.Rows.Count, "A").End(xlUp).Row + 2
Set rgOutput = .Range("A" & LstRw)
rgData.AdvancedFilter xlFilterCopy, rgCriteria, rgOutput
End With
End Sub