I have implemented a macro into my worksheet and I need to divide some numbers, it keeps giving me an error or a 0 value when I run the macro. The division looks like this:
Sub divcalc()
Dim Number_1 As Integer
Dim Number_2 As Integer
Dim Answer As Integer
Number_1 = 22
Number_2 = 2
Answer = Number_1 / Number_2
Worksheets("MIP").Range("K2").Value = Answer
End Sub
Now when I run this it works fine. However the "22" needs to actually be cell H21. so the division needs to look like this: Answer = H21 / 2
H21 is a formula that pulls a number from another tab in the worksheet, which changes based on data entered elsewhere. SO H21 is subject to change thats why it needs to be a formula.
Bookmarks