Hi, I'm a bit new to VBA.
I'm trying to create a macro to insert a new row underneath the chosen category while copying the data to that newly created row.
Example:
I am also trying to create a checkbox to the right of the data, this helps with copying the checked list to another worksheet.
Any idea on how to achieve this?
I have been using this code as a reference:
I'm trying to create a macro to insert a new row underneath the chosen category while copying the data to that newly created row.
Example:
I am also trying to create a checkbox to the right of the data, this helps with copying the checked list to another worksheet.
Any idea on how to achieve this?
I have been using this code as a reference:
VBA Code:
Sub Button2_Click()
Dim c As Range
For Each c In Range("A:A")
If c.Value Like "*BREAD, *COOKIES, *SCONES" Then
c.Offset(1, 0).EntireRow.Insert
End If
Next
Dim Area As Range, LastRow As Long
On Error Resume Next
LastRow = Cells.Find(What:="*", SearchOrder:=xlRows, _
SearchDirection:=xlPrevious, _
LookIn:=xlFormulas).Row
For Each Area In ActiveCell.EntireColumn(1).Resize(LastRow). _
SpecialCells(xlCellTypeBlanks).Areas
Area.Value = Area(1).Offset(-1).Value
Next
End Sub