close

What you're asking can't be done with worksheet functions. A cell may
contain user input OR a calculated formula. Not both. However, you can
accomplish what you want with VB Code.

Open the VB Editor (Alt-F11) and add this code to the quot;ThisWorkbookquot; object.

Dim D, M As Double

Private Sub Workbook_Open()

D = Range(quot;A1quot;).Value
M = Range(quot;B1quot;).Value

End Sub

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

If Range(quot;A1quot;).Value lt;gt; D Then
D = Range(quot;A1quot;).Value
Range(quot;B1quot;).Value = Range(quot;A1quot;).Value / 8
Else:
If Range(quot;B1quot;).Value lt;gt; M Then
M = Range(quot;B1quot;).Value
Range(quot;A1quot;).Value = Range(quot;B1quot;).Value * 8
End If
End If

End SubHope that helps,
Elkarquot;tjbquot; wrote:

gt; When the user enters a number in cell A1, I want cell B1 to divide that
gt; number by 8. If A1 is blank then B1 should be blank.
gt;
gt; Alternately, when the user enters a number in cell B1, I want cell A1 to
gt; MULTIPLY that number by 8. If B1 is blank then A1 should be blank.
gt;
gt; I'm pretty sure this has to be a workbook function but I'm not sure how to
gt; proceed. Any ideas all?

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()