Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default 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 ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default 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 ***

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Find negative value & Clear

Thanks Jim, really appreciate the help.

Tempy

*** Sent via Developersdex http://www.developersdex.com ***
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
negative numbers in parenthesis are not clear on excel printout? John Excel Discussion (Misc queries) 3 December 21st 05 03:59 PM
Find value (31.12.9999) and clear Tempy Excel Programming 3 September 13th 05 01:22 AM
CLEAR FIND BUFFER UPON CLOSING Chris in NH Excel Worksheet Functions 0 July 6th 05 06:39 PM
find a cell, jump to next roll and clear all cells Adrie Rahanra Excel Programming 0 September 10th 03 03:44 PM
find a cell, jump to next roll and clear all cells jigsaw2[_3_] Excel Programming 1 September 8th 03 05:51 PM


All times are GMT +1. The time now is 11:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"