Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find and replace just 0s in a Range using code 1

Status
Not open for further replies.

daseffects

Technical User
Aug 21, 2003
38
GB
Lets say I have a range of #'s

0, 1.01, 5.2, 10.2, 0

I want to be able to replace just the whole 0s w/ the number 1 through a comand button.

so the above would look like

1, 1.01, 5.2, 10.2, 1

I figure just regular find and replace won't do.
 
This code also changes blank cells to 1. Any way to avoid blanks or leave them as blanks
 
Using the find and replace method would be faster, record a macro replacing all 0 with 1, tick the match entire cell only and when you view the macro you will have the required syntax.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top