Excel Macro to copy text and append

Solved/Closed
sgriffis - 27 Apr 2011 à 09:44
RWomanizer Posts 365 Registration date Monday 7 February 2011 Status Contributor Last seen 30 September 2013 - 2 May 2011 à 08:30
Hello,

I recorded a macro in Excel where I copied the text from one cell and appended that text to the values in several other cells. The problem however is that Excel is not copying that data in new worksheets. It is just taking the value from the first worksheet and pasting that in all subsequent worksheets.

For example:

32-0151-8715
8716
8717
8720
8719

I want to take the first part (32-0151-) and append it to the front of all the cells below. The values will be different (but in the same format) for each worsheet, however Excel is just copying the values from the sheet where I recorded the macro, instead of copying and appending the new data each time.

Another example of data I am trying to copy/paste:

0025901E83B0
0025901E8514
0025901E851C
0025901E83D4
0025901E8604

Trying to copy the first 10 digits above and append to the front of these rows:

B1
15
1D
D5
05


Is there any way to do this?

Thanks!
Related:

4 responses

RWomanizer Posts 365 Registration date Monday 7 February 2011 Status Contributor Last seen 30 September 2013 120
28 Apr 2011 à 04:36
for First part use the formula

=CHAR(CODE(RIGHT(B2,1))+1)

*Supoose value 0025901E851C is in Cell B2

and second part use

="32-0151-" & D2

*Supoose Value 8715 is in Cell D2
OK, I think I figured out part of it. Now I just need a formula that will add 1 to a alphanumeric value in a cell. For example 0025901E851C would be 0025901E851D.

Also need a formula that will take this value:
32-0151-8715
and add the first two parts to a cell with the last part already typed in.


Thanks!
RWomanizer Posts 365 Registration date Monday 7 February 2011 Status Contributor Last seen 30 September 2013 120
2 May 2011 à 08:30
You are most Welcome