Search for blank cell and insert concatenated value

granty

Board Regular
Joined
Jul 28, 2005
Messages
117
Hi,

I would like to search a column for blank cell. if a blank cell is found, to concatenate "info required" and text in the previous column

ColA ColB ColC
Joy yes hey
Peace oh
Hope hmm ok

code to search col C, find the blank cell and insert 'info required Peace'

Thank you
 

Some videos you may like

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
It sounds like you want code, but a formula should suffice:

=IF(C1="","Info Required "&A1,"")

HTH,
 

granty

Board Regular
Joined
Jul 28, 2005
Messages
117
Thank you Smitty.

I do want a code. This is because I will download a spreadsheet with a lot of data on it. This table is pivoted on another worksheet
I want to be able to insert a code that automatically searches the column for blank cells and insert the texts above. The reason I want to concatenate the text is so that the blank lines are not grouped together on the pivot table

thanks
 

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
You can record a macro putting the formula in the first cell (D2 if you have a header row), then autofill it. Post back what you get and someone can get you set up with a dynamic last row. Or if you set up your data as an Excel Table, then the range will be dynamic automatically.
 

granty

Board Regular
Joined
Jul 28, 2005
Messages
117
Hi. This is what I have from searching 2 cells. I want to do this for all the cells in the column to the last line. Thank you

Sub concatenate()

Columns("D:D").Select
Selection.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Range("D5").Select
ActiveCell.FormulaR1C1 = "=CONCATENATE(""info reg"",RC[4])"
Columns("D:D").Select
Range("D6").Activate
Selection.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Range("D11").Select
ActiveCell.FormulaR1C1 = "=CONCATENATE(""info reg"",RC[4])"
Range("D12").Select
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,128,167
Messages
5,629,079
Members
416,364
Latest member
maatpsr

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
Top