Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default re : Help needed on some codes


Hi Experts,

Attached below is the code that I used to delete the rows that do not
have the cell values found in rng2

Dim Rngva As Range
Dim rCellva As Range
Dim delRngva As Range
Dim CalcModeva As Long
Set WB1 = Workbooks("DCR Template Daily")
Set SH1 = WB1.Sheets("Raw")
Set SH2 = WB1.Sheets("Selections")
Set rng1 = SH1.Columns("D:D")
Set rng2 = SH2.Range("C17")

With Application
CalcModeva = .Calculation
Calculation = xlCalculationAutomatic
ScreenUpdating = False
End With

For Each rCellva In rng1.Cells
If rCellva.Value < rng2 Then
If delRngva Is Nothing Then
Set delRngva = rCellva
Else
Set delRngva = Union(rCellva, delRngva)
End If
End If
Next rCellva

If Not delRngva Is Nothing Then
delRngva.EntireRow.Delete
Else
'nothing found, do nothing
End If

With Application
Calculation = CalcModeva
ScreenUpdating = False
End With

My question is, if now i want to delete the rows that the cells values
are equal to rng2, how and where should be edited in the code???


AJ


--
dic09
------------------------------------------------------------------------
dic09's Profile: http://www.excelforum.com/member.php...o&userid=36223
View this thread: http://www.excelforum.com/showthread...hreadid=560147

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
Codes needed to copy same one row from more than 300 Excel files Joe Roberto Excel Discussion (Misc queries) 1 September 25th 09 12:07 PM
2 codes in 1 puiuluipui Excel Discussion (Misc queries) 0 February 23rd 09 09:56 AM
Zip Codes Bill New Users to Excel 6 August 7th 08 10:47 PM
Codes sam Excel Discussion (Misc queries) 2 September 11th 07 02:04 PM
Help with codes please!! Nick TKA Excel Discussion (Misc queries) 0 April 28th 06 12:47 PM


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