Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Combine 2 macro
Hi,
How do I combine 2 macro that they can do at a same time? Right now, I have one macro doing "copy a sheet" and then another macro doing "delete-autofilter". I'd like to combine them together, so I don't have to execute 2 times. In other words, right after copy a sheet, it does deleted things. thanks |
#2
|
|||
|
|||
Combine 2 macro
It's probably as simple as just putting the name of the second macro as the
last line in the first. sub ddd do this do that end sub -- Don Guillett SalesAid Software "bioyyy" wrote in message ... Hi, How do I combine 2 macro that they can do at a same time? Right now, I have one macro doing "copy a sheet" and then another macro doing "delete-autofilter". I'd like to combine them together, so I don't have to execute 2 times. In other words, right after copy a sheet, it does deleted things. thanks |
#3
|
|||
|
|||
Combine 2 macro
Don,
Thanks, but still don't get it: Here are the macro: Sub Duplicate() ' ' Duplicate Macro ' ' Keyboard Shortcut: Ctrl+c ' Sheets("Sample List").Copy After:=Sheets(2) End Sub Sub Delete_with_Autofilter() Dim DeleteValue As String Dim rng As Range DeleteValue = "" ' This will delete the rows with "" in the Range("A1:A500") With ActiveSheet .Range("A1:A500").AutoFilter Field:=1, Criteria1:=DeleteValue With ActiveSheet.AutoFilter.Range On Error Resume Next Set rng = .Offset(1, 0).Resize(.Rows.Count - 1, 1) _ .SpecialCells(xlCellTypeVisible) On Error GoTo 0 If Not rng Is Nothing Then rng.EntireRow.Delete End With .AutoFilterMode = False End With End Sub Again, what I like to do: copy a sheet, then delete-autofilter. Thanks Don "Don Guillett" wrote: It's probably as simple as just putting the name of the second macro as the last line in the first. sub ddd do this do that end sub -- Don Guillett SalesAid Software "bioyyy" wrote in message ... Hi, How do I combine 2 macro that they can do at a same time? Right now, I have one macro doing "copy a sheet" and then another macro doing "delete-autofilter". I'd like to combine them together, so I don't have to execute 2 times. In other words, right after copy a sheet, it does deleted things. thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Make Alignment options under format cells available as shortcut | Excel Discussion (Misc queries) | |||
Help with macro looping and color query function | Excel Discussion (Misc queries) | |||
Combine two spreadsheets using Macro | Excel Worksheet Functions | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) | |||
Date macro | Excel Discussion (Misc queries) |