简体   繁体   中英

Copy cells from one a row in a column dependant on a value in the corresponding row in another column

I have a mailing list on excel 2003 that I need to send out dependant on month of registration.

The list is huge and the data is frequently being edited, deleted and added.

So in column QI have the month as a number January is 1 May 5 etc. I then have the email address in Column T.

So everytime the number 1 is present in column Q i need to copy the corressponding row in column T

I need to do this for each month.

Ideally i'd have 12 buttons with a Macro for each month attached.

I have no idea where to start with the macro any help would be much appreciated.

This might work for January (though based on Macro Recorder in Excel 2007):

Sub MacroJan()
    ActiveSheet.Range("A:T").AutoFilter Field:=1, Criteria1:="1"
    Columns("T:T").Select
    Selection.Copy
    Sheets.Add After:=Sheets(Sheets.Count)
    Range("A1").Select
    ActiveSheet.Paste
End Sub  

but since really only using filter, copy and paste there seems no real need for a dozen macros.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM