Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 233
  • Last Modified:

Change to worksheet and then replace value in cell

I'm needing to change to a worksheet called "Labor Totals" and then change any rows that have a Zero in them to a blank cell.

0
RedstoneIT
Asked:
RedstoneIT
1 Solution
 
Saqib Husain, SyedEngineerCommented:
Try

Sub LTdelzeros()
Dim cel As Range
Sheets("Labor Totals").Activate
For Each cel In ActiveSheet.UsedRange.Cells
If cel.Value = 0 Then cel.ClearContents
Next cel
End Sub

0
 
VipulKadiaCommented:
   worksheet("Labor Totals").Cells.Replace What:="0", Replacement:="", LookAt:=xlPart, SearchOrder:= _
        xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
0
 
Rory ArchibaldCommented:
I suspect you meant:

worksheet("Labor Totals").Cells.Replace What:="0", Replacement:="", LookAt:=xlWhole, SearchOrder:= _
        xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
0
 
Saqib Husain, SyedEngineerCommented:
and

worksheets("Labor Totals").Cells.Replace What:="0", Replacement:="", LookAt:=xlWhole, SearchOrder:= _
        xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
0
 
RedstoneITAuthor Commented:
Spot on for what I was wanting to do ! Thank you
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now