![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 17
|
Here is the code I currently use to fit my situation. It seems very repititious. There is probably an easier way to do this but this is the only way I have found that will work.
I have used the "Edit GoTo Special Blanks" method without success. So here it is - my masterpiece! If Range("E42").Value < 1 Then Range("E42").Value = "=0" End If If Range("g42").Value < 1 Then Range("g42").Value = "=0" End If If Range("i42").Value < 1 Then Range("i42").Value = "=0" End If If Range("k42").Value < 1 Then Range("k42").Value = "=0" End If If Range("m42").Value < 1 Then Range("m42").Value = "=0" End If If Range("o42").Value < 1 Then Range("o42").Value = "=0" End If If Range("q42").Value < 1 Then Range("q42").Value = "=0" End If If Range("s42").Value < 1 Then Range("s42").Value = "=0" End If If Range("u42").Value < 1 Then Range("u42").Value = "=0" End If If Range("w42").Value < 1 Then Range("w42").Value = "=0" End If If Range("y42").Value < 1 Then Range("y42").Value = "=0" End If If Range("aa42").Value < 1 Then Range("aa42").Value = "=0" End If If Range("ac42").Value < 1 Then Range("ac42").Value = "=0" End If If Range("aE42").Value < 1 Then Range("aE42").Value = "=0" End If If Range("ag42").Value < 1 Then Range("ag42").Value = "=0" End If If Range("AI42").Value < 1 Then Range("ai42").Value = "=0" End If If Range("Ak42").Value < 1 Then Range("ak42").Value = "=0" End If If Range("Am42").Value < 1 Then Range("am42").Value = "=0" End If If Range("Ao42").Value < 1 Then Range("ao42").Value = "=0" End If If Range("Aq42").Value < 1 Then Range("aq42").Value = "=0" End If If Range("As42").Value < 1 Then Range("as42").Value = "=0" End If If Range("Au42").Value < 1 Then Range("au42").Value = "=0" End If If Range("Aw42").Value < 1 Then Range("aw42").Value = "=0" End If If Range("Ay42").Value < 1 Then Range("ay42").Value = "=0" End If If Range("BA42").Value < 1 Then Range("BA42").Value = "=0" End If If Range("BC42").Value < 1 Then Range("BC42").Value = "=0" End If If Range("Be42").Value < 1 Then Range("Be42").Value = "=0" End If If Range("Bg42").Value < 1 Then Range("Bg42").Value = "=0" End If If Range("Bi42").Value < 1 Then Range("Bi42").Value = "=0" End If If Range("Bk42").Value < 1 Then Range("Bk42").Value = "=0" End If End Sub Thanks for any help anyone may have to offer - this runs on a spreadsheet where people enter numbers and text. I want it to update as entries are made so I Call this Procedure from my Workheet. |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
This should accomplish the same thing...
if you don't want the 0 and want to leave it blank then use this:
[ This Message was edited by: TsTom on 2002-04-26 04:42 ] |
|
|
|
|
|
#3 |
|
New Member
Join Date: Mar 2002
Posts: 17
|
Thanks for the help. I really need the 0. That was the whole point of this! Nice to have somewhere to go for help - what a lifesaver.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|