Search for blank cell and insert concatenated value

granty

Board Regular
Joined
Jul 28, 2005
Messages
121
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
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
It sounds like you want code, but a formula should suffice:

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

HTH,
 
Upvote 0
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
 
Upvote 0
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.
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,195
Members
449,072
Latest member
DW Draft

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