#1   Report Post  
bioyyy
 
Posts: n/a
Default 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


  #3   Report Post  
bioyyy
 
Posts: n/a
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Make Alignment options under format cells available as shortcut dforrest Excel Discussion (Misc queries) 1 July 14th 05 10:58 PM
Help with macro looping and color query function kevinm Excel Discussion (Misc queries) 10 May 26th 05 01:25 AM
Combine two spreadsheets using Macro jlogsdon Excel Worksheet Functions 0 May 23rd 05 11:14 PM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM


All times are GMT +1. The time now is 08:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"