PDA

View Full Version : [SOLVED] Alert message



chungtinhlak
12-09-2008, 07:26 PM
I have to questions:

1. I set another workbook to open and modified it a little bit then transfer the date to another workbook and close the one i started with. But when it close, the mssage box asking me to save appear, I don't want to save, so the answer is always no. After that, another message box appear telling me that copied data is too big for the clip board. how do it just ignore these ? I use application.displayaleart = false but it doens't work and it will give me a run time error.



Application.displayalert = false



2. I have a thousands of rows, after i run my macro, on column R, if it says yes, that's the data that I want. Is there a way I can delete all rows that doesn't contain yes on column R?

thanks

slamet Harto
12-09-2008, 07:40 PM
try with
Application.DisplayAlerts = False

slamet Harto
12-09-2008, 07:44 PM
Sub DeleteRow()
Dim RangeToBeDeleted As Range
Dim xRowsCount As Long
Dim r As Long
On Error Resume Next
Set RangeToBeDeleted = Application.InputBox( _
Prompt:="Select range.!", _
Title:="DELETED Rows", _
Default:=Selection.Address, Type:=8)
xRowsCount = RangeToBeDeleted.Rows.Count
Application.Calculation = xlCalculationManual
For r = xRowsCount To 1 Step -1
If RangeToBeDeleted(r, 1).value="No" Then
RangeToBeDeleted(r, 1).EntireRow.Delete
End If
Next r
Application.Calculation = xlCalculationAutomatic

mdmackillop
12-10-2008, 10:41 AM
Sub KeepYes()
With Range("R:R")
.AutoFilter Field:=1, Criteria1:="<>Yes"
.SpecialCells(xlCellTypeVisible).EntireRow.Delete
.AutoFilter
End With
End Sub