Ok, do this:
1. Create a new workbook
2. Press Alt+F11 to open VB editor
3. Insert a new module
4. Paste the code into it (here it is again...)
Sub CleanTrendReport()
'Declare variables
Dim r As Long 'Current row number
Dim x As String 'Value from cell
'Set constants
Const c = 9 'The column to check for duplicates in the sheet
Const sQuarantine = "Virus successfully detected, cannot perform the Clean action (Quarantine)"
Const sClean = "Clean"
'Turn off screen updating
Application.ScreenUpdating
'Find last row number
r = Cells(65536, c).End(xlUp).Row
Do Until r <= 1
'Read value into variable
x = Cells(r, c).Value
'Check value and delete row
If x = Cells(r + 1, c).Value Or x = sClean Or x = sQuarantine Then Rows(r).Delete
'Decrease row value
r = r - 1
Loop
'Make noise and turn screen updating back on
Beep
Application.ScreenUpdating
End Sub
5. Press Alt+F4 to return to Excel
6. File Save-As...
File name: CleanTrendReport
Save as type: Microsoft Excel Add-In (xla) - at the bottom of the list
(You may be automatically moved to the AddIns directory, that's OK)
7. Click Save
8. Close the open workbook (Don't save if asked)
9. Create a new, blank workbook
10. Tools - AddIns - Browse...
(Find and select your AddIn)
11. OK, OK
Done!
/Ture
Main Topics
Browse All Topics





by: tapankhatriPosted on 2004-02-11 at 06:05:17ID: 10332161
You can do two things you can keep the file opened when ever you receive some document,
When you goto run macro you can see the macro i.e. run macro from different doc (original document)
Or you have to create module > paste the pacro > run the macro.
This time i expect something.
Tapan.