ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Formatting Cells? (https://www.excelbanter.com/excel-worksheet-functions/145650-formatting-cells.html)

Ben

Formatting Cells?
 
Hello,
I need to know how to put an * before and after each value I have in a
column. For example, if Column A is 1 to 5, I will paste them in B, and then
change them to barcode font. My scanner only reads barcodes that start and
end in an * . It is easy to do it for a few by hand, but when there are
thousands, there has to be an easy way to do it. Thanks in advance.



PCLIVE

Formatting Cells?
 
In B1:

="*" & A1 & "*"

Copy this down as needed.

HTH,
Paul

"Ben" wrote in message
...
Hello,
I need to know how to put an * before and after each value I have in a
column. For example, if Column A is 1 to 5, I will paste them in B, and
then
change them to barcode font. My scanner only reads barcodes that start
and
end in an * . It is easy to do it for a few by hand, but when there are
thousands, there has to be an easy way to do it. Thanks in advance.





Gord Dibben

Formatting Cells?
 
Ben

With "thousands" a macro may serve you well to change them in place.

Sub Add_Text()
Dim cell As Range
Dim thisrng As Range
On Error GoTo endit
Set thisrng = Range(ActiveCell.Address & "," & Selection.Address) _
.SpecialCells(xlCellTypeConstants, xlTextValues)
For Each cell In thisrng
cell.Value = "*" & cell.Value & "*"
Next
Exit Sub
endit:
MsgBox "only formulas in range"
End Sub


Gord Dibben MS Excel MVP

On Thu, 7 Jun 2007 09:09:01 -0700, Ben wrote:

Hello,
I need to know how to put an * before and after each value I have in a
column. For example, if Column A is 1 to 5, I will paste them in B, and then
change them to barcode font. My scanner only reads barcodes that start and
end in an * . It is easy to do it for a few by hand, but when there are
thousands, there has to be an easy way to do it. Thanks in advance.




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

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