Find Cell and copy that found value down to next empty cell

silentwolf

Well-known Member
Joined
May 14, 2008
Messages
1,216
Office Version
  1. 2016
Hi guys,

I know I am a pain today but I am working on something and need a little help.

VBA Code:
Sub KontenklassenInNewColumnTest()
    Dim wksThis As Worksheet
    Dim C As Range
    
    Set wksThis = ActiveSheet
    
    With wksThis
        For Each C In Range("A1:A" & .Cells(.rows.Count, "A").End(xlUp).Row)
            If C.Value Like "*Kontenklasse*" Then    '<-- if cell contains "Konten"
            
                Kontenklassen = C.Value     'Property Kontenklassen

            
                C.Offset(1, 5).Value = Kontenklassen



                Else
            End If
        Next C
    End With
End Sub
Now I put the result into a Property ..

What I like to do or achive is following...

1. Kontenklasse 0 - Anlagevermögen
120 Software
1. Kontenklasse 0 - Anlagevermögen

2. Kontenklasse 2...
2500 Vorsteuer2. Kontenklasse 2..


in each "Kontenklasse can be more then one -... I like to update the worksheet so if it finds any cell with "*Kontenklasse*" then insert 1 column down and 5 columns to the right till it reaches the first empy cell

At the moment it copy the same value as in column A for each row but I like to have the "header" copied to all subklasses of that Kontenklasse

Hope that is clear what I am after..?

Thanks for your help again!
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,214,520
Messages
6,120,007
Members
448,935
Latest member
ijat

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top