ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find negative value & Clear (https://www.excelbanter.com/excel-programming/339856-find-negative-value-clear.html)

Tempy

Find negative value & Clear
 
Hi all, i have some negative values (-123) in column "T" and i need to
clear these minus values only. I have a spreadsheet that can be upto
2000 rows or longer with other values in "T" also.
Could you please help with some code.

thanks in advance.

Tempy

*** Sent via Developersdex http://www.developersdex.com ***

Jim Thomlinson[_4_]

Find negative value & Clear
 
Sub ClearNegatives()
Dim rngToSearch As Range
Dim rngCurrent As Range
Dim wks As Worksheet

Set wks = ActiveSheet
Set rngToSearch = Range(wks.Range("T2"), _
wks.Cells(Rows.Count, "T").End(xlUp))
For Each rngCurrent In rngToSearch
If rngCurrent.Value < 0 Then _
rngCurrent.Value = ""
Next rngCurrent
End Sub

--
HTH...

Jim Thomlinson


"Tempy" wrote:

Hi all, i have some negative values (-123) in column "T" and i need to
clear these minus values only. I have a spreadsheet that can be upto
2000 rows or longer with other values in "T" also.
Could you please help with some code.

thanks in advance.

Tempy

*** Sent via Developersdex http://www.developersdex.com ***


Tempy

Find negative value & Clear
 
Thanks Jim, really appreciate the help.

Tempy

*** Sent via Developersdex http://www.developersdex.com ***


All times are GMT +1. The time now is 05:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com