• 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.

VBA for copy modified rows in to new sheet

Thanks, i am new for the macro.


Could you please give me the full code and tell me how to apply this code to my sheet.


I have one code with me but its not showing in the Macros menu.


below is the code :


Option Explicit


Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Count > 1 Then Exit Sub

If Not Intersect(Target, Range("Q2:AA400")) Is Nothing Then

Target.EntireRow.Copy _

Destination:=Sheets("Sheet2").Range("A65536").End(xlUp)(2)

End If


End Sub
 
Digit


Firstly, Welcome to the Chandoo.org forums.


The code must be copied and pasted into a Worksheet Module in the VBA Editor

Copy the text

In Excel

open the file

Alt F11 to got VBA

In VBA find the worksheet module for the page you wish this to apply to

Double click it

Paste the code into the right hand pane


Please also note that although this problem may be Urgent for you, it may not be for the rest of us. All problems are answered as time and talent allows.

I direct you to the three Green Posts at the top of http://chandoo.org/forums/
 
Hi Satish ,


You do not need to bother even if this macro does not show up in the Macros menu.


What you do need to do is :


Copy this macro in whichever sheet section that this applies to e.g. if you want that modified rows in Sheet4 need to be copied into a new sheet ( by the way , this new sheet will always be Sheet2 , since this is hard-coded into the macro ) , then copy this code in the Sheet4 section of your VBA Project.


Since this is an event macro , it will be triggered automatically whenever any cell in the range Q2:AA400 on tab Sheet4 is changed by the user ( remember that changes in any formula within this range due to a change in any other cell outside this range will not trigger this event ).


Also , please remember , the entire row is copied to a new row in the new sheet based on an assumption that column A will contain some data ; if column A does not contain data , then the new modified row will always be copied to row 2 in the new sheet , thus overwriting the earlier written data.


Narayan
 
Hi Hui & Narayan,


Thanks a ton for your time.


this code is working for me. can you any one help me on this again.


Requirement : when the user save this workbook one email (Outlook) should come to me with the attachement.


can you give me the VBA code for this.


Regards,

Satish.
 
Hi Satish ,


I have personally not developed anything on this , so I cannot give any code on this.


If you can go through an earlier article on this , check out :


http://chandoo.org/wp/2012/04/23/send-mails-using-excel-vba-and-outlook/


Narayan
 
Back
Top