ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Selective concatenation using VBA (https://www.excelbanter.com/excel-worksheet-functions/139268-selective-concatenation-using-vba.html)

Colin Hayes

Selective concatenation using VBA
 

Hi

In column A , I have some cells with content , some blank.

In column B , all the cells have content.

I need to transfer the content of the cells in column B to column A ,
BUT ONLY to the cells in column A which are blank.

Cells which already have content in column A should remain unchanged.
Only the blank ones should be updated with the content of the cells from
B.

Don Guillett

Selective concatenation using VBA
 
try
Sub copytoblank()
For Each c In Range("a18:a23")
If Len(c) < 2 Then c.Value = c.Offset(, 1)
Next
End Sub

--
Don Guillett
SalesAid Software

"Colin Hayes" wrote in message
...

Hi

In column A , I have some cells with content , some blank.

In column B , all the cells have content.

I need to transfer the content of the cells in column B to column A , BUT
ONLY to the cells in column A which are blank.

Cells which already have content in column A should remain unchanged. Only
the blank ones should be updated with the content of the cells from B.

Can someone help with small routine to do this?

Grateful for any assistance.



Best Wishes


Colin



Teethless mama

Selective concatenation using VBA
 
AutoFilter Blanks in Column A, now you have all the blank cells in column A
enter the formula in the first blank cell in column A
example the first blank cell is in A5. Formula in A5: =B5, drag the Fill
Handle to copy


"Colin Hayes" wrote:


Hi

In column A , I have some cells with content , some blank.

In column B , all the cells have content.

I need to transfer the content of the cells in column B to column A ,
BUT ONLY to the cells in column A which are blank.

Cells which already have content in column A should remain unchanged.
Only the blank ones should be updated with the content of the cells from
B.

Can someone help with small routine to do this?

Grateful for any assistance.



Best Wishes


Colin


JE McGimpsey

Selective concatenation using VBA
 
Then, if you need to actually transfer the content (rather than just the
reference), select column A, copy it, and choose Edit/Paste Special,
selecting the Values radio button. Click OK.

In article ,
Teethless mama wrote:

AutoFilter Blanks in Column A, now you have all the blank cells in column A
enter the formula in the first blank cell in column A
example the first blank cell is in A5. Formula in A5: =B5, drag the Fill
Handle to copy


"Colin Hayes" wrote:


Hi

In column A , I have some cells with content , some blank.

In column B , all the cells have content.

I need to transfer the content of the cells in column B to column A ,
BUT ONLY to the cells in column A which are blank.



All times are GMT +1. The time now is 03:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com