hello
this is th first post I hope finding what I search of it actually I search so much in the internet but I don't find what I want so I have data they classed to many categories in column a what I want when i select from combobox based on column a , then insert a new row before row contains word is total and copy what I fill in textbox1,2,3 to the column b,c,d in the inserted empty row
Private Sub ComboBox1_Change()
Dim ws As Worksheet, Rng As Range, Sel As Variant
Set ws = Sheets("Task List")
Sel = Me.ComboBox1.Value
If Sel <> "" Then
Set Rng = ws.Columns(1).Find(Sel, lookat:=xlWhole)
If Not Rng Is Nothing Then
Call InsertBlankRowsBasedOnCellValue
End If
End If
Sub InsertBlankRowsBasedOnCellValue()
Dim Col As Variant
Dim BlankRows As Long
Dim LastRow As Long
Dim R As Long
Dim StartRow As Long
Col = "a"
StartRow = 1
BlankRows = 1
LastRow = Cells(Rows.Count, Col).End(xlUp).Row
Application.ScreenUpdating = False
With ActiveSheet
For R = LastRow To StartRow + 1 Step -1
If .Cells(R, Col) = "TOTAL" Then
.Cells(R, Col).EntireRow.Insert Shift:=xlDown
End If
Next R
End With
Application.ScreenUpdating = True
End Sub
End Sub
I truly appreciate if anybody helps