Changes Required In Macro Code

T

TGV

Dear Mike boss,

Please do a small correction in your below vb code that is when it finally
concatenating the cells I want to concatenate the cells in the below
mentioned order.

C1, D1 & A1 like this the macro should concatenate. But in the above code
its concatenating A1,C1 & D1.

So Please help. I have tried to change the code in the above order but I am
not able to do it.

You can only help me.

Thank you

TGV
 
M

Mike H

Hi,

Try this

Sub marine()
x = 1
Dim MyRange As Range
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
Set MyRange = Range("A1:A" & LastRow)
For Each c In MyRange
c.Offset(, 2).Value = x
c.Offset(, 1).Value = c.Offset(, 2).Value & _
c.Offset(, 3).Value & c.Value
If x < 200 Then
x = x + 1
Else
x = 1
End If
Next
End Sub

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top