LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Problem with matching pasted cells

OK, I have a userform where a user will input values. Then the program will
copy and paste row values from another workbook and write the input values in
worksheets("Selection").Range("D4").End(xlDown) I have this macro that will
look at one column "S" in a different worksheet("System") and if it doesn't
match with values in ("D4").End(xlDown) it will delete the entire row. But it
doesn't work it deletes every row even if they are similar values, curiously
if I type in a value in Column "S" it works. This is what I have. Thanks in
advance.

Sub Redundancy()
Dim iLastRow As Long
Dim i As Long
'With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
'End With
iLastRow = worksheets("System").Cells(Rows.Count, "S").End(xlUp).Row
For i = iLastRow To 2 Step -1
If IsError(Application.Match(worksheets("System").Cel ls(i,
"S").Value, _
worksheets("Selection").Range("D4").End(xlDown), 0)) Then
worksheets("System").Cells(i, "S").EntireRow.Delete
Shift:=xlUp
End If
Next i
If worksheets("System").Column("S:S").Value = "" Then
worksheets("System").EntireRow.Delete
End If
With Application
.ScreenUpdating = True
.Calculation = CalcMode
End With
End Sub
 
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
Problem with excel charts pasted into Word laudrup Excel Discussion (Misc queries) 2 March 9th 06 12:08 AM
Not all pasted text appears in cells cjswift Excel Discussion (Misc queries) 1 August 8th 05 03:43 PM
VBA: Pasted Cells Not Formatted ajocius[_3_] Excel Programming 1 July 23rd 05 05:55 PM
cell validation even for values pasted into cells JR_06062005 Excel Worksheet Functions 2 July 13th 05 05:36 PM
how do I remove spaces from cells that were pasted GolfKing Excel Discussion (Misc queries) 1 December 31st 04 07:40 AM


All times are GMT +1. The time now is 05:50 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"