Question : How do i create an Excel macro to copy/paste cell contents from one cell to another?

I am trying to create a macro to copy data from one cell, and append it to the data in another cell.  So, for example, if there is data in cell A1 that says "example", and data in cell C1 that says "macro/test/" i would like the macro to copy the data in A1 and paste it in C1 so that the final C1 says "macro/test/example".  At the moment i can get it to work for A1 and C1, but when i move to A2 and C2, it's pasting A1 in A2 and C1 in C2.  Hopefully that's easy enough to decipher :-\  Any help is appreciated

Answer : How do i create an Excel macro to copy/paste cell contents from one cell to another?

Another way to do this. This will run the macro automatically till the last row filled of A Column and will do what you are looking for...

Saurabh...

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
Sub change()
    Dim rng As Range, cell As Range
    Set rng = Range("A1:A" & Cells(65536, "a").End(xlUp).Row)
    For Each cell In rng
        If cell.Value <> "" Then
            cell.Offset(0, 2).Value = cell.Offset(0, 2).Value & cell.Value
        End If
    Next cell
 
    MsgBox "Done"
 
End Sub
Random Solutions  
 
programming4us programming4us