ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I append the same text to multiple cells? (https://www.excelbanter.com/excel-programming/383325-how-do-i-append-same-text-multiple-cells.html)

mike herman

How do I append the same text to multiple cells?
 
I want to add a "" to each cell in a column of cells when the cell isn't
blank. I'm doing this in a macro for multiple workbooks, so I want the
fastest/most efficient way possible.

My current idea is:
Given the column with text is column A, insert a new row with the formula
=IF(T(A2)<"",""&A2,"") and drag that formula down, then paste special
values over into the location I want the data.
Is there a better way?

Gary''s Student

How do I append the same text to multiple cells?
 
This should be very quick. Just select the cells and run the macro:

Sub mike()
For Each r In Selection
If IsEmpty(r.Value) Then
Else
r.Value = r.Value & ""
End If
Next
End Sub

--
Gary's Student
gsnu200706


"mike herman" wrote:

I want to add a "" to each cell in a column of cells when the cell isn't
blank. I'm doing this in a macro for multiple workbooks, so I want the
fastest/most efficient way possible.

My current idea is:
Given the column with text is column A, insert a new row with the formula
=IF(T(A2)<"",""&A2,"") and drag that formula down, then paste special
values over into the location I want the data.
Is there a better way?



All times are GMT +1. The time now is 04:21 PM.

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