Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88835

Copy paste a range in a specific column if the conditions are met

$
0
0

I would want to paste a range of names from one sheet to the other in a specific column H. I would want to paste these names across for only those items that are in "submitted status" in Column C. Also, The names that i copy should be dynamic. I should be able to remove or add names in the list and it should not cause any errors if i remove any names from the list before i run the macro.

Below is the code:

Sub Assign3()
'' Assign3 Macro
''
    Selection.AutoFilter
    ActiveSheet.Range("$A$1:$M$65").AutoFilter Field:=3, Criteria1:="Submitted"
    Range("C1").Select
    Selection.End(xlDown).Select
    Range("H65").Select
    Selection.End(xlUp).Select
    Range("H14").Select
    Selection.AutoFilter
    Sheets("Sheet2").Select
    Range("A1").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Copy
    Sheets("Sheet1").Select
    ActiveSheet.Paste
    ActiveWindow.SmallScroll Down:=9
    Application.CutCopyMode = False
    Selection.AutoFill Destination:=Range("H14:H65")
    Range("H14:H65").Select
    Selection.End(xlUp).Select
    Selection.End(xlToLeft).Select
End Sub

Viewing all articles
Browse latest Browse all 88835

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>