![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Feb 2002
Location: State? Insanity! :)
Posts: 26
|
OK.. If I have product numbers in column A of a file, and I want to add a couple characters to the beginning of each number. example.. code is "123".. I want the code to be "FF123" is there a simple way to do this? Either an add command, or even creating a whole column of "FF" and them merging them? I do not wish to do this manually by editing as there are THOUSANDS of rows to edit. thanks! |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
The formula-way is just: ="FF"&A1 where A1 houses the first entry that you want to modify. Enter this in B1 and give a double click on its fill handle in order to copy the formula down. Then copy all of the cells in B and execute Edit|Paste Special >Values in place. Delete column A. Aladin |
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Posts: 202
|
assuming your numbers are in column A, select column B and type in FF or whatever in the formula bar. press ctrl+shift+enter simultaneously, which will put 'FF' in the entire column. in the first row of column C, put =A1&B1 and copy this down as far as needed using the fill handle (bottom right of cell). then select column C again, do copy> paste special>values and delete column B
|
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Mar 2002
Posts: 1,805
|
Here is a macro, need some polish but works,
Sub AddFF() Dim myRange As Range Set myRange = Range("A1:A5000") For i = 1 To myRange.Cells.Count myRange.Cells(i).Value = "FF" & myRange.Cells(i).Value Next i End Sub Just adjust the number of rows (set to 5000) Eli |
|
|
|
|
|
#5 |
|
New Member
Join Date: Feb 2002
Location: State? Insanity! :)
Posts: 26
|
Great! .. thanks guys!
You've been a great help! |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|