ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I had a suffix to a cell i.e. -1,-2,-3? (https://www.excelbanter.com/excel-discussion-misc-queries/34907-how-do-i-had-suffix-cell-i-e-1-2-3-a.html)

controller_woman

How do I had a suffix to a cell i.e. -1,-2,-3?
 
How do I had a suffix to a cell i.e. -1,-2,-3?

Chip Pearson

You need VBA code to do this.

Sub AAA()
Dim Rng As Range
Dim N As Integer: N = 1
For Each Rng In Range("A1:A5") ' change range as needed
Rng.Value = Rng.Text & "-" & Format(N, "0")
N = N + 1
Next Rng
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"controller_woman"
wrote in message
...
How do I had a suffix to a cell i.e. -1,-2,-3?





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

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