• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Copy/Paste, CONCATENATE, xlPasteValues

ludmilla91

New Member
Dear Everybody,
I'd like to expand this code to my whole worksheet, which has 327 rows.

Sub program()
'
' program Macro
'
'
'
Range("D1").Select
ActiveCell.FormulaR1C1 = "=CONCATENATE(RC[-1],"" "",R[1]C[-3])"
Range("D1").Select
Selection.Copy
Range("D2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("C1:D1").Select
Application.CutCopyMode = False
Selection.ClearContents
Range("D2").Select
Selection.Copy
Range("C1").Select
ActiveSheet.Paste
Rows("2:3").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlUp
Range("A2").Select
Selection.Copy
Range("B1").Select
ActiveSheet.Paste
Range("E1").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=IF((LEFT(RC[-4],4))>(LEFT(RC[-3],4)),1,0)"
Range("E2").Select
End Sub

How should I do that? Sorry, I'm an absolute beginner in this field.

Thank you,
Ludmilla
 
Dear Asheesh,
I uploaded the sample file.
Another purpose is: when the column "E"=1, the "B" cell sould be deleted.
Thank you very much!
Ludmilla
 

Attachments

  • sample_macro.xlsm
    22.6 KB · Views: 1
Hey ludmilla,

You will have to give me time till weekend till I give you the solution for this one as I am little busy
 
Okay, thank you so much! :)
One more thing that I forgot: when the column "E"=1, the cell "B" should be cleared, AND pls insert a new row too!
Have a nice week!
 
Back
Top