View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernard Liengme[_3_] Bernard Liengme[_3_] is offline
external usenet poster
 
Posts: 1,104
Default Formula in Excel Help Please

Not sure I understand. You have cells F4:K4 with either blanks or values.
You want to change theses cells or other cells?

Easy case: change other cells
In some other cell (say F5) enter =IF(ISBLANK(F4),0,62.50)
Format the cell as currency
Copy the formula across the row

Change the actual cells: that will require VBA

Sub tryme()
myrow = 4
For mycol = 6 To 10
If Cells(myrow, mycol).Value = "" Or Cells(myrow, mycol).Value = 0 Then
Cells(myrow, mycol).Value = 0
Else
Cells(myrow, mycol).Value = 62.5
Cells(myrow, mycol).NumberFormat = "$#,##0.00_);($#,##0.00)"
End If
Next
End Sub

New to VBA? See one or both of these:
David McRitchie's site on "getting started" with VBA
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Debra Dalgleish's "Adding Code to a Workbook"
http://www.contextures.com:80/xlvba01.html

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"TMansell" wrote in message
...
I need a formula the says, If these cells F4:K4 have blanks then they = 0
if
there are no blanks then = $62.50. How do i do this?
--
TMansell