Act like I'm changing a value of a cell

abmaul

New Member
Joined
Nov 9, 2014
Messages
13
I have a formula with an input and an output but I don't want to manually enter the input multiple times then see what the output it and manually enter it into another cell. Is their a simple way to do this?
 
Thank you very much. I guess I'm going to have to figure out where to insert this code? Sorry I'm not a pro Excel user.
 
Upvote 0

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
I think that what Mole is after is that the steps that the spreadsheet does to calculate the shock length to the frame height can be coded into a VBA UDF.

But given your current set-up this Macro should fill in the chart thats at the bottom of your data set.
You'll want to make the "Sheet1" match your sheet name and you might want to fiddle with the range through which X goes.

Code:
Sub test()
    Dim X as Double
    Dim myCell as Range

    With Sheets("Sheet1")
        Set myCell = .Range("C36")

        For X = 15 To 3 Step -.025
            myCell.Value = x
            .Range("D7").Value = x
            Calculate
            myCell.Offset(0,1).Value = .Range("F33").Value
            Set MyCell = myCell.Offset(1, 0)
        Next X
    End With
End Sub

Actualy if you are going to be doing this regularly, you could use VBA to create a lookup chart of values.
Then rather than going through the D7/F33 routine you could either look up the value from the chart or interpolate for intermediate values (I don't me you personally, I mean that spread sheet formulas can do that, while they can't do the D7/F333)

Are there any other variable besides D7? or is this the shocklenght for a particular frame of a particular construction and if that changes the result will change.

If F33 is purely a function of one variable (D77) it would probably be worth your time to code it in a VBA UDF rather that go through the worksheet.


Mike, This was pure genius. This is exactly what I wanted but never thought possible through Excel.
 
Upvote 0

Forum statistics

Threads
1,215,330
Messages
6,124,307
Members
449,151
Latest member
JOOJ

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top